Browse Source

Added a flag to disable inline asm.

tags/2021-05-28
jules 13 years ago
parent
commit
438159d01a
3 changed files with 10 additions and 6 deletions
  1. +2
    -2
      modules/juce_core/memory/juce_ByteOrder.h
  2. +3
    -3
      modules/juce_core/native/juce_mac_SystemStats.mm
  3. +5
    -1
      modules/juce_core/system/juce_PlatformDefs.h

+ 2
- 2
modules/juce_core/memory/juce_ByteOrder.h View File

@@ -118,12 +118,12 @@ inline uint32 ByteOrder::swap (uint32 n)
{ {
#if JUCE_MAC || JUCE_IOS #if JUCE_MAC || JUCE_IOS
return OSSwapInt32 (n); return OSSwapInt32 (n);
#elif JUCE_GCC && JUCE_INTEL
#elif JUCE_GCC && JUCE_INTEL && ! JUCE_NO_INLINE_ASM
asm("bswap %%eax" : "=a"(n) : "a"(n)); asm("bswap %%eax" : "=a"(n) : "a"(n));
return n; return n;
#elif JUCE_USE_INTRINSICS #elif JUCE_USE_INTRINSICS
return _byteswap_ulong (n); return _byteswap_ulong (n);
#elif JUCE_MSVC
#elif JUCE_MSVC && ! JUCE_NO_INLINE_ASM
__asm { __asm {
mov eax, n mov eax, n
bswap eax bswap eax


+ 3
- 3
modules/juce_core/native/juce_mac_SystemStats.mm View File

@@ -42,7 +42,7 @@ void Logger::outputDebugString (const String& text)
//============================================================================== //==============================================================================
namespace SystemStatsHelpers 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) static void doCPUID (uint32& a, uint32& b, uint32& c, uint32& d, uint32 type)
{ {
uint32 la = a, lb = b, lc = c, ld = d; uint32 la = a, lb = b, lc = c, ld = d;
@@ -64,7 +64,7 @@ namespace SystemStatsHelpers
//============================================================================== //==============================================================================
SystemStats::CPUFlags::CPUFlags() SystemStats::CPUFlags::CPUFlags()
{ {
#if JUCE_INTEL
#if JUCE_INTEL && ! JUCE_NO_INLINE_ASM
uint32 familyModel = 0, extFeatures = 0, features = 0, dummy = 0; uint32 familyModel = 0, extFeatures = 0, features = 0, dummy = 0;
SystemStatsHelpers::doCPUID (familyModel, extFeatures, dummy, features, 1); SystemStatsHelpers::doCPUID (familyModel, extFeatures, dummy, features, 1);
@@ -155,7 +155,7 @@ int SystemStats::getMemorySizeInMegabytes()
String SystemStats::getCpuVendor() String SystemStats::getCpuVendor()
{ {
#if JUCE_INTEL
#if JUCE_INTEL && ! JUCE_NO_INLINE_ASM
uint32 dummy = 0; uint32 dummy = 0;
uint32 vendor[4] = { 0 }; uint32 vendor[4] = { 0 };


+ 5
- 1
modules/juce_core/system/juce_PlatformDefs.h View File

@@ -73,7 +73,11 @@
#endif #endif
#define juce_breakDebugger { __debugbreak(); } #define juce_breakDebugger { __debugbreak(); }
#elif JUCE_GCC || JUCE_MAC #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 #else
#define juce_breakDebugger { __asm int 3 } #define juce_breakDebugger { __asm int 3 }
#endif #endif


Loading…
Cancel
Save