Browse Source

Fix juce-legacy for macOS 11

tags/2021-01-15
falkTX 3 years ago
parent
commit
18f868c0f8
6 changed files with 26 additions and 25 deletions
  1. +11
    -7
      libs/juce-legacy/source/modules/juce_core/native/juce_mac_SystemStats.mm
  2. +0
    -11
      libs/juce-legacy/source/modules/juce_core/native/juce_osx_ObjCHelpers.h
  3. +3
    -1
      libs/juce-legacy/source/modules/juce_core/system/juce_PlatformDefs.h
  4. +4
    -3
      libs/juce-legacy/source/modules/juce_core/system/juce_SystemStats.h
  5. +7
    -2
      libs/juce-legacy/source/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm
  6. +1
    -1
      ports-legacy/meson.build

+ 11
- 7
libs/juce-legacy/source/modules/juce_core/native/juce_mac_SystemStats.mm View File

@@ -120,11 +120,17 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType()
StringArray parts;
parts.addTokens (getOSXVersion(), ".", StringRef());
jassert (parts[0].getIntValue() == 10);
const int major = parts[1].getIntValue();
jassert (major > 2);
const auto major = parts[0].getIntValue();
const auto minor = parts[1].getIntValue();
return (OperatingSystemType) (major + MacOSX_10_4 - 4);
if (major == 10)
{
jassert (minor > 2);
return (OperatingSystemType) (minor + MacOSX_10_7 - 7);
}
jassert (major == 11 && minor == 0);
return MacOSX_11_0;
#endif
}
@@ -157,10 +163,8 @@ bool SystemStats::isOperatingSystem64Bit()
{
#if JUCE_IOS
return false;
#elif JUCE_64BIT
return true;
#else
return getOperatingSystemType() >= MacOSX_10_6;
return true;
#endif
}


+ 0
- 11
libs/juce-legacy/source/modules/juce_core/native/juce_osx_ObjCHelpers.h View File

@@ -96,17 +96,6 @@ static inline ReturnValue ObjCMsgSendSuper (struct objc_super* s, SEL sel, Param
// These hacks are a workaround for newer Xcode builds which by default prevent calls to these objc functions..
typedef id (*MsgSendSuperFn) (struct objc_super*, SEL, ...);
static inline MsgSendSuperFn getMsgSendSuperFn() noexcept { return (MsgSendSuperFn) (void*) objc_msgSendSuper; }
#if ! JUCE_IOS
typedef double (*MsgSendFPRetFn) (id, SEL op, ...);
static inline MsgSendFPRetFn getMsgSendFPRetFn() noexcept { return (MsgSendFPRetFn) (void*)
#if JUCE_ARM
objc_msgSend;
#else
objc_msgSend_fpret;
#endif
}
#endif
#endif
//==============================================================================


+ 3
- 1
libs/juce-legacy/source/modules/juce_core/system/juce_PlatformDefs.h View File

@@ -62,12 +62,14 @@ namespace juce
@see jassert()
*/
#define JUCE_BREAK_IN_DEBUGGER { ::kill (0, SIGTRAP); }
#elif JUCE_MAC && JUCE_CLANG && JUCE_ARM
#define JUCE_BREAK_IN_DEBUGGER { __builtin_debugtrap(); }
#elif JUCE_MSVC
#ifndef __INTEL_COMPILER
#pragma intrinsic (__debugbreak)
#endif
#define JUCE_BREAK_IN_DEBUGGER { __debugbreak(); }
#elif JUCE_GCC || JUCE_MAC
#elif JUCE_INTEL && (JUCE_GCC || JUCE_MAC)
#if JUCE_NO_INLINE_ASM
#define JUCE_BREAK_IN_DEBUGGER { }
#else


+ 4
- 3
libs/juce-legacy/source/modules/juce_core/system/juce_SystemStats.h View File

@@ -50,15 +50,16 @@ public:
Android = 0x0800,
iOS = 0x1000,
MacOSX_10_4 = MacOSX | 4,
MacOSX_10_5 = MacOSX | 5,
MacOSX_10_6 = MacOSX | 6,
MacOSX_10_7 = MacOSX | 7,
MacOSX_10_8 = MacOSX | 8,
MacOSX_10_9 = MacOSX | 9,
MacOSX_10_10 = MacOSX | 10,
MacOSX_10_11 = MacOSX | 11,
MacOSX_10_12 = MacOSX | 12,
MacOSX_10_13 = MacOSX | 13,
MacOSX_10_14 = MacOSX | 14,
MacOSX_10_15 = MacOSX | 15,
MacOSX_11_0 = MacOSX | 16,
Win2000 = Windows | 1,
WinXP = Windows | 2,


+ 7
- 2
libs/juce-legacy/source/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm View File

@@ -24,6 +24,11 @@
==============================================================================
*/
@interface NSEvent (DeviceDelta)
- (float)deviceDeltaX;
- (float)deviceDeltaY;
@end
namespace juce
{
typedef void (*AppFocusChangeCallback)();
@@ -640,8 +645,8 @@ public:
#endif
if ([ev respondsToSelector: @selector (deviceDeltaX)])
{
wheel.deltaX = checkDeviceDeltaReturnValue ((float) getMsgSendFPRetFn() (ev, @selector (deviceDeltaX)));
wheel.deltaY = checkDeviceDeltaReturnValue ((float) getMsgSendFPRetFn() (ev, @selector (deviceDeltaY)));
wheel.deltaX = checkDeviceDeltaReturnValue ([ev deviceDeltaX]);
wheel.deltaY = checkDeviceDeltaReturnValue ([ev deviceDeltaY]);
}
}
@catch (...)


+ 1
- 1
ports-legacy/meson.build View File

@@ -223,7 +223,7 @@ if build_lv2 or build_vst2
link_with_plugin += lib_juced
endif

if plugin_uses_opengl
if plugin_uses_opengl or buildtype == 'debug'
if os_darwin
plugin_extra_link_flags += [
'-framework', 'OpenGL',


Loading…
Cancel
Save