From 4e3b778c6239bcb096436b35cbec0ec81db18ac0 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 20 Aug 2025 15:56:43 +1000 Subject: [PATCH 1/3] Silence some warnings about unused functions. --- miniaudio.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/miniaudio.h b/miniaudio.h index 938d1abf..08d6c617 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -19987,7 +19987,7 @@ Timing *******************************************************************************/ #if defined(MA_WIN32) && !defined(MA_POSIX) static LARGE_INTEGER g_ma_TimerFrequency; /* <-- Initialized to zero since it's static. */ - static void ma_timer_init(ma_timer* pTimer) + static MA_INLINE void ma_timer_init(ma_timer* pTimer) { LARGE_INTEGER counter; @@ -19999,7 +19999,7 @@ Timing pTimer->counter = counter.QuadPart; } - static double ma_timer_get_time_in_seconds(ma_timer* pTimer) + static MA_INLINE double ma_timer_get_time_in_seconds(ma_timer* pTimer) { LARGE_INTEGER counter; if (!QueryPerformanceCounter(&counter)) { @@ -20010,7 +20010,7 @@ Timing } #elif defined(MA_APPLE) && (MAC_OS_X_VERSION_MIN_REQUIRED < 101200) static ma_uint64 g_ma_TimerFrequency = 0; - static void ma_timer_init(ma_timer* pTimer) + static MA_INLINE void ma_timer_init(ma_timer* pTimer) { mach_timebase_info_data_t baseTime; mach_timebase_info(&baseTime); @@ -20019,7 +20019,7 @@ Timing pTimer->counter = mach_absolute_time(); } - static double ma_timer_get_time_in_seconds(ma_timer* pTimer) + static MA_INLINE double ma_timer_get_time_in_seconds(ma_timer* pTimer) { ma_uint64 newTimeCounter = mach_absolute_time(); ma_uint64 oldTimeCounter = pTimer->counter; @@ -20044,7 +20044,7 @@ Timing #define MA_CLOCK_ID CLOCK_REALTIME #endif - static void ma_timer_init(ma_timer* pTimer) + static MA_INLINE void ma_timer_init(ma_timer* pTimer) { struct timespec newTime; clock_gettime(MA_CLOCK_ID, &newTime); @@ -20052,7 +20052,7 @@ Timing pTimer->counter = (newTime.tv_sec * 1000000000) + newTime.tv_nsec; } - static double ma_timer_get_time_in_seconds(ma_timer* pTimer) + static MA_INLINE double ma_timer_get_time_in_seconds(ma_timer* pTimer) { ma_uint64 newTimeCounter; ma_uint64 oldTimeCounter; @@ -20066,7 +20066,7 @@ Timing return (newTimeCounter - oldTimeCounter) / 1000000000.0; } #else - static void ma_timer_init(ma_timer* pTimer) + static MA_INLINE void ma_timer_init(ma_timer* pTimer) { struct timeval newTime; gettimeofday(&newTime, NULL); @@ -20074,7 +20074,7 @@ Timing pTimer->counter = (newTime.tv_sec * 1000000) + newTime.tv_usec; } - static double ma_timer_get_time_in_seconds(ma_timer* pTimer) + static MA_INLINE double ma_timer_get_time_in_seconds(ma_timer* pTimer) { ma_uint64 newTimeCounter; ma_uint64 oldTimeCounter; From 3567d5cfef0f4bfee5bbcb8dcf3cde1dfc1273b9 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 20 Aug 2025 16:04:15 +1000 Subject: [PATCH 2/3] Fix compilation error with MA_NO_SSE2. --- miniaudio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miniaudio.h b/miniaudio.h index 08d6c617..a6494327 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -12079,7 +12079,7 @@ static MA_INLINE unsigned int ma_disable_denormals(void) } #elif defined(MA_X86) || defined(MA_X64) { - #if defined(__SSE2__) && !(defined(__TINYC__) || defined(__WATCOMC__) || defined(__COSMOPOLITAN__)) /* <-- Add compilers that lack support for _mm_getcsr() and _mm_setcsr() to this list. */ + #if defined(MA_SUPPORT_SSE2) && defined(__SSE2__) && !(defined(__TINYC__) || defined(__WATCOMC__) || defined(__COSMOPOLITAN__)) /* <-- Add compilers that lack support for _mm_getcsr() and _mm_setcsr() to this list. */ { prevState = _mm_getcsr(); _mm_setcsr(prevState | MA_MM_DENORMALS_ZERO_MASK | MA_MM_FLUSH_ZERO_MASK); @@ -12119,7 +12119,7 @@ static MA_INLINE void ma_restore_denormals(unsigned int prevState) } #elif defined(MA_X86) || defined(MA_X64) { - #if defined(__SSE2__) && !(defined(__TINYC__) || defined(__WATCOMC__) || defined(__COSMOPOLITAN__)) /* <-- Add compilers that lack support for _mm_getcsr() and _mm_setcsr() to this list. */ + #if defined(MA_SUPPORT_SSE2) && defined(__SSE2__) && !(defined(__TINYC__) || defined(__WATCOMC__) || defined(__COSMOPOLITAN__)) /* <-- Add compilers that lack support for _mm_getcsr() and _mm_setcsr() to this list. */ { _mm_setcsr(prevState); } From f6bae251bde9f194f26835117e04f10e26f30463 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 20 Aug 2025 16:09:44 +1000 Subject: [PATCH 3/3] verblib: Try fixing a compilation error on macOS. --- extras/nodes/ma_reverb_node/verblib.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/extras/nodes/ma_reverb_node/verblib.h b/extras/nodes/ma_reverb_node/verblib.h index 12603092..459b102d 100644 --- a/extras/nodes/ma_reverb_node/verblib.h +++ b/extras/nodes/ma_reverb_node/verblib.h @@ -248,13 +248,23 @@ extern "C" { #include #ifdef _MSC_VER -#define VERBLIB_INLINE __forceinline + #define VERBLIB_INLINE __forceinline +#elif defined(__GNUC__) + #if defined(__STRICT_ANSI__) + #define VERBLIB_GNUC_INLINE_HINT __inline__ + #else + #define VERBLIB_GNUC_INLINE_HINT inline + #endif + + #if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)) || defined(__clang__) + #define VERBLIB_INLINE VERBLIB_GNUC_INLINE_HINT __attribute__((always_inline)) + #else + #define VERBLIB_INLINE VERBLIB_GNUC_INLINE_HINT + #endif +#elif defined(__WATCOMC__) + #define VERBLIB_INLINE __inline #else -#ifdef __GNUC__ -#define VERBLIB_INLINE inline __attribute__((always_inline)) -#else -#define VERBLIB_INLINE inline -#endif + #define VERBLIB_INLINE #endif #define verblib_max(x, y) (((x) > (y)) ? (x) : (y))