Skip to content

Commit

Permalink
fix hotreload on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Markos-Th09 authored and Jummit committed May 9, 2024
1 parent 2a19bc6 commit 7709ad5
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 7709ad5

Please sign in to comment.