diff --git a/modules/juce_core/maths/juce_BigInteger.cpp b/modules/juce_core/maths/juce_BigInteger.cpp index f037101562..0e2b1d9383 100644 --- a/modules/juce_core/maths/juce_BigInteger.cpp +++ b/modules/juce_core/maths/juce_BigInteger.cpp @@ -315,7 +315,7 @@ inline static int highestBitInInt (uint32 n) noexcept { jassert (n != 0); // (the built-in functions may not work for n = 0) - #if JUCE_GCC + #if JUCE_GCC || JUCE_CLANG return 31 - __builtin_clz (n); #elif JUCE_USE_MSVC_INTRINSICS unsigned long highest; diff --git a/modules/juce_core/memory/juce_Atomic.h b/modules/juce_core/memory/juce_Atomic.h index 970d4d38ee..1e8a65cc44 100644 --- a/modules/juce_core/memory/juce_Atomic.h +++ b/modules/juce_core/memory/juce_Atomic.h @@ -201,7 +201,7 @@ private: #endif //============================================================================== -#elif (JUCE_GCC || JUCE_CLANG) && ! JUCE_MSVC +#elif JUCE_GCC || JUCE_CLANG #define JUCE_ATOMICS_GCC 1 // GCC with intrinsics #if JUCE_IOS || JUCE_ANDROID // (64-bit ops will compile but not link on these mobile OSes) diff --git a/modules/juce_core/memory/juce_ByteOrder.h b/modules/juce_core/memory/juce_ByteOrder.h index 680f432f39..02c0f71aec 100644 --- a/modules/juce_core/memory/juce_ByteOrder.h +++ b/modules/juce_core/memory/juce_ByteOrder.h @@ -157,7 +157,7 @@ inline uint32 ByteOrder::swap (uint32 n) noexcept { #if JUCE_MAC || JUCE_IOS return OSSwapInt32 (n); - #elif JUCE_GCC && JUCE_INTEL && ! JUCE_NO_INLINE_ASM + #elif (JUCE_GCC || JUCE_CLANG) && JUCE_INTEL && ! JUCE_NO_INLINE_ASM asm("bswap %%eax" : "=a"(n) : "a"(n)); return n; #elif JUCE_USE_MSVC_INTRINSICS diff --git a/modules/juce_core/native/juce_win32_SystemStats.cpp b/modules/juce_core/native/juce_win32_SystemStats.cpp index eb4c45ba83..bc207acaaa 100644 --- a/modules/juce_core/native/juce_win32_SystemStats.cpp +++ b/modules/juce_core/native/juce_win32_SystemStats.cpp @@ -58,7 +58,7 @@ static void callCPUID (int result[4], int infoType) __try #endif { - #if JUCE_GCC + #if JUCE_GCC || JUCE_CLANG __asm__ __volatile__ ("cpuid" : "=a" (result[0]), "=b" (result[1]), "=c" (result[2]),"=d" (result[3]) : "a" (infoType)); #else __asm @@ -331,7 +331,7 @@ static int64 juce_getClockCycleCounter() noexcept // MS intrinsics version... return (int64) __rdtsc(); - #elif JUCE_GCC + #elif JUCE_GCC || JUCE_CLANG // GNU inline asm version... unsigned int hi = 0, lo = 0; diff --git a/modules/juce_core/system/juce_PlatformDefs.h b/modules/juce_core/system/juce_PlatformDefs.h index 45e34efb1d..c07774e430 100644 --- a/modules/juce_core/system/juce_PlatformDefs.h +++ b/modules/juce_core/system/juce_PlatformDefs.h @@ -290,7 +290,7 @@ #elif JUCE_MSVC && ! JUCE_NO_DEPRECATION_WARNINGS #define JUCE_DEPRECATED(functionDef) __declspec(deprecated) functionDef #define JUCE_DEPRECATED_WITH_BODY(functionDef, body) __declspec(deprecated) functionDef body -#elif JUCE_GCC && ! JUCE_NO_DEPRECATION_WARNINGS +#elif (JUCE_GCC || JUCE_CLANG) && ! JUCE_NO_DEPRECATION_WARNINGS #define JUCE_DEPRECATED(functionDef) functionDef __attribute__ ((deprecated)) #define JUCE_DEPRECATED_WITH_BODY(functionDef, body) functionDef __attribute__ ((deprecated)) body #else @@ -308,7 +308,7 @@ #endif //============================================================================== -#if JUCE_GCC +#if JUCE_GCC || JUCE_CLANG #define JUCE_PACKED __attribute__((packed)) #elif ! DOXYGEN #define JUCE_PACKED diff --git a/modules/juce_core/system/juce_TargetPlatform.h b/modules/juce_core/system/juce_TargetPlatform.h index 12143a10ae..6b4c6f1730 100644 --- a/modules/juce_core/system/juce_TargetPlatform.h +++ b/modules/juce_core/system/juce_TargetPlatform.h @@ -39,7 +39,7 @@ - Either JUCE_32BIT or JUCE_64BIT, depending on the architecture. - Either JUCE_LITTLE_ENDIAN or JUCE_BIG_ENDIAN. - Either JUCE_INTEL or JUCE_PPC - - Either JUCE_GCC or JUCE_MSVC + - Either JUCE_GCC or JUCE_CLANG or JUCE_MSVC */ //============================================================================== @@ -179,7 +179,6 @@ #ifdef __clang__ #define JUCE_CLANG 1 - #define JUCE_GCC 1 #elif defined (__GNUC__) #define JUCE_GCC 1 #elif defined (_MSC_VER) diff --git a/modules/juce_graphics/colour/juce_PixelFormats.h b/modules/juce_graphics/colour/juce_PixelFormats.h index 0df5987b13..0666dd79f4 100644 --- a/modules/juce_graphics/colour/juce_PixelFormats.h +++ b/modules/juce_graphics/colour/juce_PixelFormats.h @@ -108,7 +108,7 @@ public: forcedinline uint8 getGreen() const noexcept { return components.g; } forcedinline uint8 getBlue() const noexcept { return components.b; } - #if JUCE_GCC && ! JUCE_CLANG + #if JUCE_GCC // NB these are here as a workaround because GCC refuses to bind to packed values. forcedinline uint8& getAlpha() noexcept { return comps [indexA]; } forcedinline uint8& getRed() noexcept { return comps [indexR]; } diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index 203d6bd12c..f5450e9a4c 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -1539,7 +1539,7 @@ private: DeleteObject (rgn); EndPaint (hwnd, &paintStruct); - #ifndef JUCE_GCC + #if JUCE_MSVC _fpreset(); // because some graphics cards can unmask FP exceptions #endif