From 33805bf33d3f54ef69a8cee7c61d4b08dfc75a7e Mon Sep 17 00:00:00 2001 From: Adam Wilson Date: Thu, 5 Mar 2015 21:27:27 +0000 Subject: [PATCH 1/2] #undef's for android compatibility --- stk.cpp | 11 ++++++++++- stk.h | 10 ++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/stk.cpp b/stk.cpp index 922fffa..6ef3152 100644 --- a/stk.cpp +++ b/stk.cpp @@ -64,6 +64,15 @@ #pragma clang diagnostic ignored "-Wtautological-compare" #endif +#if JUCE_ANDROID + + // Stk.h defines stk::swap16/32/64. This conflicts with macros in on Android. Workaround: undefine them in the stk.h juce module header + #pragma message ("undefining swap16/32/64 macros to avoid conflict with stk header") + #undef swap16 + #undef swap32 + #undef swap64 +#endif + #if JUCE_MSVC #pragma warning (push) #pragma warning (disable: 4127 4702 4244 4305 4100 4996 4309) @@ -151,4 +160,4 @@ #ifdef __clang__ #pragma pop // -Wtautological-compare -#endif \ No newline at end of file +#endif diff --git a/stk.h b/stk.h index 884e6ac..fa6667d 100644 --- a/stk.h +++ b/stk.h @@ -53,6 +53,16 @@ #define __LITTLE_ENDIAN__ #endif +#if JUCE_ANDROID + + #include + // Stk.h defines stk::swap16/32/64. This conflicts with macros in on Android. Workaround: undefine them in the stk.h juce module header + #pragma message ("undefining swap16/32/64 macros to avoid conflict with stk header") + #undef swap16 + #undef swap32 + #undef swap64 +#endif + #if JUCE_MAC #define __MACOSX_CORE__ #endif From 3c749127c82d40dc14257fb550eef32b80680248 Mon Sep 17 00:00:00 2001 From: Adam Wilson Date: Fri, 6 Mar 2015 22:29:33 +0000 Subject: [PATCH 2/2] moved undefs to stk/Stk.h --- stk.cpp | 9 --------- stk.h | 10 ---------- stk/Stk.h | 9 +++++++++ 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/stk.cpp b/stk.cpp index 6ef3152..3ad9a9f 100644 --- a/stk.cpp +++ b/stk.cpp @@ -64,15 +64,6 @@ #pragma clang diagnostic ignored "-Wtautological-compare" #endif -#if JUCE_ANDROID - - // Stk.h defines stk::swap16/32/64. This conflicts with macros in on Android. Workaround: undefine them in the stk.h juce module header - #pragma message ("undefining swap16/32/64 macros to avoid conflict with stk header") - #undef swap16 - #undef swap32 - #undef swap64 -#endif - #if JUCE_MSVC #pragma warning (push) #pragma warning (disable: 4127 4702 4244 4305 4100 4996 4309) diff --git a/stk.h b/stk.h index fa6667d..884e6ac 100644 --- a/stk.h +++ b/stk.h @@ -53,16 +53,6 @@ #define __LITTLE_ENDIAN__ #endif -#if JUCE_ANDROID - - #include - // Stk.h defines stk::swap16/32/64. This conflicts with macros in on Android. Workaround: undefine them in the stk.h juce module header - #pragma message ("undefining swap16/32/64 macros to avoid conflict with stk header") - #undef swap16 - #undef swap32 - #undef swap64 -#endif - #if JUCE_MAC #define __MACOSX_CORE__ #endif diff --git a/stk/Stk.h b/stk/Stk.h index 17cfcb8..3b555ff 100644 --- a/stk/Stk.h +++ b/stk/Stk.h @@ -7,6 +7,15 @@ #include #include +#if JUCE_ANDROID + #include + // Stk.h defines stk::swap16/32/64. This conflicts with macros in on Android. Workaround: undefine them in the stk.h juce module header + #pragma message ("undefining swap16/32/64 macros to avoid conflict with stk header") + #undef swap16 + #undef swap32 + #undef swap64 +#endif + /*! \namespace stk \brief The STK namespace.