diff --git a/src/FAudio_internal.h b/src/FAudio_internal.h index ed255f1d5..039ab9216 100644 --- a/src/FAudio_internal.h +++ b/src/FAudio_internal.h @@ -41,9 +41,6 @@ #define WIN32_LEAN_AND_MEAN #include -#define NO_MEMCPY_OVERRIDE -#define NO_MEMSET_OVERRIDE - #define FAudio_malloc malloc #define FAudio_realloc realloc #define FAudio_free free @@ -128,6 +125,13 @@ extern void FAudio_Log(char const *msg); #define FAudio_swap64LE(x) SDL_Swap64LE(x) #define FAudio_swap64BE(x) SDL_Swap64BE(x) +/* SDL3 allows memcpy/memset for compiler optimization reasons */ +#ifdef SDL_SLOW_MEMCPY +#define STB_MEMCPY_OVERRIDE +#endif +#ifdef SDL_SLOW_MEMSET +#define STB_MEMSET_OVERRIDE +#endif #else #include #include @@ -140,14 +144,9 @@ extern void FAudio_Log(char const *msg); #define FAudio_swap32BE(x) SDL_SwapBE32(x) #define FAudio_swap64LE(x) SDL_SwapLE64(x) #define FAudio_swap64BE(x) SDL_SwapBE64(x) -#endif -/* SDL3 allows memcpy/memset for compiler optimization reasons */ -#ifndef SDL_SLOW_MEMCPY -#define NO_MEMCPY_OVERRIDE -#endif -#ifndef SDL_SLOW_MEMSET -#define NO_MEMSET_OVERRIDE +#define STB_MEMCPY_OVERRIDE +#define STB_MEMSET_OVERRIDE #endif #define FAudio_malloc SDL_malloc diff --git a/src/XNA_Song.c b/src/XNA_Song.c index d2e0021a4..73f999105 100644 --- a/src/XNA_Song.c +++ b/src/XNA_Song.c @@ -33,18 +33,18 @@ #define malloc FAudio_malloc #define realloc FAudio_realloc #define free FAudio_free -#ifndef NO_MEMSET_OVERRIDE +#ifdef STB_MEMSET_OVERRIDE #ifdef memset /* Thanks, Apple! */ #undef memset #endif #define memset FAudio_memset -#endif /* NO_MEMSET_OVERRIDE */ -#ifndef NO_MEMCPY_OVERRIDE +#endif /* STB_MEMSET_OVERRIDE */ +#ifdef STB_MEMCPY_OVERRIDE #ifdef memcpy /* Thanks, Apple! */ #undef memcpy #endif #define memcpy FAudio_memcpy -#endif /* NO_MEMCPY_OVERRIDE */ +#endif /* STB_MEMCPY_OVERRIDE */ #define memcmp FAudio_memcmp #define pow FAudio_pow diff --git a/src/stb.h b/src/stb.h index 5665cc48b..f412e0f8e 100644 --- a/src/stb.h +++ b/src/stb.h @@ -207,7 +207,7 @@ CREDITS * binding various stdlib functions stb.h uses to FAudio's stdlib. * -flibit */ -#ifndef NO_MEMCPY_OVERRIDE +#ifdef STB_MEMCPY_OVERRIDE #ifdef memcpy /* Thanks Apple! */ #undef memcpy #endif