Browse Source

OSX 10.5 SDK and GCC fixes.

tags/2021-05-28
jules 13 years ago
parent
commit
5001ead53a
7 changed files with 23 additions and 3 deletions
  1. +1
    -1
      modules/juce_core/memory/juce_Atomic.h
  2. +1
    -1
      modules/juce_core/system/juce_PlatformDefs.h
  3. +3
    -0
      modules/juce_core/system/juce_TargetPlatform.h
  4. +1
    -1
      modules/juce_core/threads/juce_ThreadLocalValue.h
  5. +11
    -0
      modules/juce_graphics/colour/juce_PixelFormats.h
  6. +2
    -0
      modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm
  7. +4
    -0
      modules/juce_gui_basics/native/juce_mac_Windowing.mm

+ 1
- 1
modules/juce_core/memory/juce_Atomic.h View File

@@ -181,7 +181,7 @@ private:
/*
The following code is in the header so that the atomics can be inlined where possible...
*/
#if JUCE_IOS || (JUCE_MAC && (JUCE_PPC || defined (__clang__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)))
#if JUCE_IOS || (JUCE_MAC && (JUCE_PPC || JUCE_CLANG || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)))
#define JUCE_ATOMICS_MAC 1 // Older OSX builds using gcc4.1 or earlier
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5


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

@@ -294,7 +294,7 @@ namespace juce
#define JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS 1
#endif
#if defined (__clang__) && defined (__has_feature)
#if JUCE_CLANG && defined (__has_feature)
#if __has_feature (cxx_nullptr)
#define JUCE_COMPILER_SUPPORTS_NULLPTR 1
#endif


+ 3
- 0
modules/juce_core/system/juce_TargetPlatform.h View File

@@ -185,5 +185,8 @@
#error unknown compiler
#endif
#ifdef __clang__
#define JUCE_CLANG 1
#endif
#endif // __JUCE_TARGETPLATFORM_JUCEHEADER__

+ 1
- 1
modules/juce_core/threads/juce_ThreadLocalValue.h View File

@@ -28,7 +28,7 @@
// (NB: on win32, native thread-locals aren't possible in a dynamically loaded DLL in XP).
#if ! ((JUCE_MSVC && (defined (_WIN64) || ! defined (JucePlugin_PluginCode))) \
|| (JUCE_MAC && defined (__clang__) && defined (MAC_OS_X_VERSION_10_7) \
|| (JUCE_MAC && JUCE_CLANG && defined (MAC_OS_X_VERSION_10_7) \
&& MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7))
#define JUCE_NO_COMPILER_THREAD_LOCAL 1
#endif


+ 11
- 0
modules/juce_graphics/colour/juce_PixelFormats.h View File

@@ -77,10 +77,18 @@ public:
forcedinline uint8 getGreen() const noexcept { return components.g; }
forcedinline uint8 getBlue() const noexcept { return components.b; }
#if JUCE_GCC && ! JUCE_CLANG
// 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]; }
forcedinline uint8& getGreen() noexcept { return comps [indexG]; }
forcedinline uint8& getBlue() noexcept { return comps [indexB]; }
#else
forcedinline uint8& getAlpha() noexcept { return components.a; }
forcedinline uint8& getRed() noexcept { return components.r; }
forcedinline uint8& getGreen() noexcept { return components.g; }
forcedinline uint8& getBlue() noexcept { return components.b; }
#endif
/** Blends another pixel onto this one.
@@ -279,6 +287,9 @@ private:
{
uint32 argb;
Components components;
#if JUCE_GCC
uint8 comps[4];
#endif
};
}
#ifndef DOXYGEN


+ 2
- 0
modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm View File

@@ -1788,8 +1788,10 @@ bool KeyPress::isKeyCurrentlyDown (const int keyCode)
ModifierKeys ModifierKeys::getCurrentModifiersRealtime() noexcept
{
#if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
if ([NSEvent respondsToSelector: @selector (modifierFlags)])
NSViewComponentPeer::updateModifiers ((NSUInteger) [NSEvent modifierFlags]);
#endif
return NSViewComponentPeer::currentModifiers;
}


+ 4
- 0
modules/juce_gui_basics/native/juce_mac_Windowing.mm View File

@@ -375,6 +375,10 @@ String SystemClipboard::getTextFromClipboard()
void Process::setDockIconVisible (bool isVisible)
{
#if defined (MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6)
[NSApp setActivationPolicy: isVisible ? NSApplicationActivationPolicyRegular
: NSApplicationActivationPolicyProhibited];
#else
jassertfalse; // sorry, not available in 10.5!
#endif
}

Loading…
Cancel
Save