From 438159d01aafa10a15771a1626b549bf413e8668 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 24 Apr 2012 21:50:54 +0100 Subject: [PATCH] Added a flag to disable inline asm. --- modules/juce_core/memory/juce_ByteOrder.h | 4 ++-- modules/juce_core/native/juce_mac_SystemStats.mm | 6 +++--- modules/juce_core/system/juce_PlatformDefs.h | 6 +++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/juce_core/memory/juce_ByteOrder.h b/modules/juce_core/memory/juce_ByteOrder.h index aca5bbf78d..86698198f1 100644 --- a/modules/juce_core/memory/juce_ByteOrder.h +++ b/modules/juce_core/memory/juce_ByteOrder.h @@ -118,12 +118,12 @@ inline uint32 ByteOrder::swap (uint32 n) { #if JUCE_MAC || JUCE_IOS return OSSwapInt32 (n); - #elif JUCE_GCC && JUCE_INTEL + #elif JUCE_GCC && JUCE_INTEL && ! JUCE_NO_INLINE_ASM asm("bswap %%eax" : "=a"(n) : "a"(n)); return n; #elif JUCE_USE_INTRINSICS return _byteswap_ulong (n); - #elif JUCE_MSVC + #elif JUCE_MSVC && ! JUCE_NO_INLINE_ASM __asm { mov eax, n bswap eax diff --git a/modules/juce_core/native/juce_mac_SystemStats.mm b/modules/juce_core/native/juce_mac_SystemStats.mm index d0f4143a48..91595d72ff 100644 --- a/modules/juce_core/native/juce_mac_SystemStats.mm +++ b/modules/juce_core/native/juce_mac_SystemStats.mm @@ -42,7 +42,7 @@ void Logger::outputDebugString (const String& text) //============================================================================== namespace SystemStatsHelpers { - #if JUCE_INTEL + #if JUCE_INTEL && ! JUCE_NO_INLINE_ASM static void doCPUID (uint32& a, uint32& b, uint32& c, uint32& d, uint32 type) { uint32 la = a, lb = b, lc = c, ld = d; @@ -64,7 +64,7 @@ namespace SystemStatsHelpers //============================================================================== SystemStats::CPUFlags::CPUFlags() { - #if JUCE_INTEL + #if JUCE_INTEL && ! JUCE_NO_INLINE_ASM uint32 familyModel = 0, extFeatures = 0, features = 0, dummy = 0; SystemStatsHelpers::doCPUID (familyModel, extFeatures, dummy, features, 1); @@ -155,7 +155,7 @@ int SystemStats::getMemorySizeInMegabytes() String SystemStats::getCpuVendor() { - #if JUCE_INTEL + #if JUCE_INTEL && ! JUCE_NO_INLINE_ASM uint32 dummy = 0; uint32 vendor[4] = { 0 }; diff --git a/modules/juce_core/system/juce_PlatformDefs.h b/modules/juce_core/system/juce_PlatformDefs.h index 353e7d59ca..df9a708b4b 100644 --- a/modules/juce_core/system/juce_PlatformDefs.h +++ b/modules/juce_core/system/juce_PlatformDefs.h @@ -73,7 +73,11 @@ #endif #define juce_breakDebugger { __debugbreak(); } #elif JUCE_GCC || JUCE_MAC - #define juce_breakDebugger { asm ("int $3"); } + #if JUCE_NO_INLINE_ASM + #define juce_breakDebugger { } + #else + #define juce_breakDebugger { asm ("int $3"); } + #endif #else #define juce_breakDebugger { __asm int 3 } #endif