From afdfb293f6044b9f192e8b4c1cc1532e4815cc17 Mon Sep 17 00:00:00 2001 From: oparviai Date: Tue, 7 Jan 2014 18:24:28 +0000 Subject: [PATCH] Apple compatibility fixes --- include/STTypes.h | 6 +++++- source/SoundTouch/cpu_detect_x86.cpp | 21 +++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/include/STTypes.h b/include/STTypes.h index 46da0fe..63950e1 100644 --- a/include/STTypes.h +++ b/include/STTypes.h @@ -63,7 +63,11 @@ typedef unsigned long ulong; #ifndef _WINDEF_ // if these aren't defined already by Windows headers, define now - typedef int BOOL; +#if defined(__APPLE__) + typedef signed char BOOL; +#else + typedef int BOOL; +#endif #define FALSE 0 #define TRUE 1 diff --git a/source/SoundTouch/cpu_detect_x86.cpp b/source/SoundTouch/cpu_detect_x86.cpp index c30476c..55be6ed 100644 --- a/source/SoundTouch/cpu_detect_x86.cpp +++ b/source/SoundTouch/cpu_detect_x86.cpp @@ -42,19 +42,20 @@ #include "cpu_detect.h" #include "STTypes.h" + #if defined(SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS) - #if defined(__GNUC__) && defined(__i386__) - // gcc - #include "cpuid.h" - #elif defined(_M_IX86) - // windows non-gcc - #include - #define bit_MMX (1 << 23) - #define bit_SSE (1 << 25) - #define bit_SSE2 (1 << 26) - #endif + #if defined(__GNUC__) && defined(__i386__) + // gcc + #include "cpuid.h" + #elif defined(_M_IX86) + // windows non-gcc + #include + #endif + #define bit_MMX (1 << 23) + #define bit_SSE (1 << 25) + #define bit_SSE2 (1 << 26) #endif