From 7709ad5d17f33dc0f993b92761effdfc953a4834 Mon Sep 17 00:00:00 2001 From: MarkosTh09 Date: Sat, 2 Mar 2024 15:13:11 +0400 Subject: [PATCH] fix hotreload on windows --- src/plug.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plug.c b/src/plug.c index ff912b2..4b0e9e8 100644 --- a/src/plug.c +++ b/src/plug.c @@ -19,12 +19,18 @@ #ifndef MUSIALIZER_UNBUNDLE #include "bundle.h" -void plug_free_resource(void *data) +#ifdef _WIN32 +#define MUSIALIZER_PLUG __declspec(dllexport) +#else +#define MUSIALIZER_PLUG +#endif + +MUSIALIZER_PLUG void plug_free_resource(void *data) { (void) data; } -void *plug_load_resource(const char *file_path, size_t *size) +MUSIALIZER_PLUG void *plug_load_resource(const char *file_path, size_t *size) { for (size_t i = 0; i < resources_count; ++i) { if (strcmp(resources[i].file_path, file_path) == 0) { @@ -37,12 +43,12 @@ void *plug_load_resource(const char *file_path, size_t *size) #else -void plug_free_resource(void *data) +MUSIALIZER_PLUG void plug_free_resource(void *data) { UnloadFileData(data); } -void *plug_load_resource(const char *file_path, size_t *size) +MUSIALIZER_PLUG void *plug_load_resource(const char *file_path, size_t *size) { int dataSize; void *data = LoadFileData(file_path, &dataSize); @@ -110,12 +116,6 @@ void *plug_load_resource(const char *file_path, size_t *size) # define subcc(a, b) ((a)-(b)) #endif -#ifdef _WIN32 -#define MUSIALIZER_PLUG __declspec(dllexport) -#else -#define MUSIALIZER_PLUG -#endif - typedef struct { char *file_path; Music music;