1 diff -u /src/cpu_detect_x86.cpp /src/cpu_detect_x86.cpp
2 --- /src/cpu_detect_x86.cpp
3 +++ /src/cpu_detect_x86.cpp
7 #if defined(SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS)
9 - #if defined(__GNUC__) && defined(__i386__)
11 + #if defined(__GNUC__) && defined(HAVE_CPUID_H)
14 #elif defined(_M_IX86)
20 -#if defined(__GNUC__)
21 - // GCC version of cpuid. Requires GCC 4.3.0 or later for __cpuid intrinsic support.
22 - uint eax, ebx, ecx, edx; // unsigned int is the standard type. uint is defined by the compiler and not guaranteed to be portable.
24 - // Check if no cpuid support.
25 - if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) return 0; // always disable extensions.
27 - if (edx & bit_MMX) res = res | SUPPORT_MMX;
28 - if (edx & bit_SSE) res = res | SUPPORT_SSE;
29 - if (edx & bit_SSE2) res = res | SUPPORT_SSE2;
32 +#if !defined(__GNUC__)
33 // Window / VS version of cpuid. Notice that Visual Studio 2005 or later required
34 // for __cpuid intrinsic support.
37 if ((unsigned int)reg[3] & bit_MMX) res = res | SUPPORT_MMX;
38 if ((unsigned int)reg[3] & bit_SSE) res = res | SUPPORT_SSE;
39 if ((unsigned int)reg[3] & bit_SSE2) res = res | SUPPORT_SSE2;
40 +#elif defined(HAVE_CPUID_H)
41 + // GCC version of cpuid. Requires GCC 4.3.0 or later for __cpuid intrinsic support.
42 + uint eax, ebx, ecx, edx; // unsigned int is the standard type. uint is defined by the compiler and not guaranteed to be portable.
44 + // Check if no cpuid support.
45 + if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) return 0; // always disable extensions.
47 + if (edx & bit_MMX) res = res | SUPPORT_MMX;
48 + if (edx & bit_SSE) res = res | SUPPORT_SSE;
49 + if (edx & bit_SSE2) res = res | SUPPORT_SSE2;
51 + // Compatible with GCC but no cpuid.h.
55 return res & ~_dwDisabledISA;
56 diff -u /src/STTypes.h /src/STTypes.h
60 #define SOUNDTOUCH_ALIGN_POINTER_16(x) ( ( (ulongptr)(x) + 15 ) & ~(ulongptr)15 )
63 -#if (defined(__GNUC__) && !defined(ANDROID))
64 - // In GCC, include soundtouch_config.h made by config scritps.
65 - // Skip this in Android compilation that uses GCC but without configure scripts.
66 - #include "soundtouch_config.h"
68 +#include "soundtouch_config.h"
71 +#if defined(BUILDING_SOUNDTOUCH)
72 +#define SOUNDTOUCH_API __declspec(dllexport)
74 +#define SOUNDTOUCH_API __declspec(dllimport)
77 +#define SOUNDTOUCH_API
82 diff -u /src/SoundTouch.h /src/SoundTouch.h
86 /// tempo/pitch/rate/samplerate settings.
87 #define SETTING_NOMINAL_OUTPUT_SEQUENCE 7
89 -class SoundTouch : public FIFOProcessor
90 +class SOUNDTOUCH_API SoundTouch : public FIFOProcessor
93 /// Rate transposer class instance
94 diff -u /src/FIRFilter.cpp /src/FIRFilter.cpp
95 --- /src/FIRFilter.cpp
96 +++ /src/FIRFilter.cpp
99 FIRFilter * FIRFilter::newInstance()
101 +#if defined(SOUNDTOUCH_ALLOW_MMX) || defined(SOUNDTOUCH_ALLOW_SSE)
104 uExtensions = detectCPUextensions();
107 // Check if MMX/SSE instruction set extensions supported by CPU
109 diff -u /src/TDStretch.cpp /src/TDStretch.cpp
110 --- /src/TDStretch.cpp
111 +++ /src/TDStretch.cpp
114 TDStretch * TDStretch::newInstance()
116 +#if defined(SOUNDTOUCH_ALLOW_MMX) || defined(SOUNDTOUCH_ALLOW_SSE)
119 uExtensions = detectCPUextensions();
122 // Check if MMX/SSE instruction set extensions supported by CPU
124 diff -u /src/AAFilter.cpp /src/AAFilter.cpp
125 --- /src/AAFilter.cpp
126 +++ /src/AAFilter.cpp
129 using namespace soundtouch;
131 -#define PI 3.14159265358979323846
133 #define TWOPI (2 * PI)
135 // define this to save AA filter coefficients to a file