From f98c2c936ca3637c634f0adef605602fe07d0b55 Mon Sep 17 00:00:00 2001 From: Jens Verwiebe Date: Sat, 15 Dec 2012 11:15:05 +0000 Subject: OSX/availability: use of the numerical value instead of the symbol in the #if MAC_OS_X_VERSION_MIN_REQUIRED comparison clause: If the code is loaded on an older system that does not include the symbol definition, the comparison still works --- intern/ghost/intern/GHOST_SystemCocoa.mm | 6 +++--- intern/ghost/intern/GHOST_WindowCocoa.mm | 16 ++++++++-------- intern/itasc/kdl/chain.hpp | 2 +- intern/itasc/kdl/tree.hpp | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'intern') diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 7f6b69d9d50..aca1a4071d8 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -56,7 +56,7 @@ #include "AssertMacros.h" #pragma mark KeyMap, mouse converters -#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 +#if MAC_OS_X_VERSION_MIN_REQUIRED <= 1040 /* Keycodes not defined in Tiger */ /* * Summary: @@ -360,7 +360,7 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction) return (GHOST_TKey) (recvChar - 'a' + GHOST_kKeyA); } else { -#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 +#if MAC_OS_X_VERSION_MIN_REQUIRED <= 1040 KeyboardLayoutRef keyLayout; UCKeyboardLayout *uchrData; @@ -423,7 +423,7 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction) #pragma mark defines for 10.6 api not documented in 10.5 -#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 +#if MAC_OS_X_VERSION_MIN_REQUIRED <= 1040 enum { /* The following event types are available on some hardware on 10.5.2 and later */ NSEventTypeGesture = 29, diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 6c5dbe83f4c..792836b0a21 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -28,7 +28,7 @@ #include -#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MIN_REQUIRED <= 1050 //Use of the SetSystemUIMode function (64bit compatible) #include #endif @@ -58,7 +58,7 @@ extern "C" { extern void wm_draw_update(bContext *C); };*/ @interface CocoaWindowDelegate : NSObject -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 #endif { @@ -115,12 +115,12 @@ extern "C" { - (void)windowDidResize:(NSNotification *)notification { -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 //if (![[notification object] inLiveResize]) { //Send event only once, at end of resize operation (when user has released mouse button) #endif systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, associatedWindow); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 //} #endif /* Live resize ugly patch. Needed because live resize runs in a modal loop, not letting main loop run @@ -287,7 +287,7 @@ extern "C" { } } -#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 +#if MAC_OS_X_VERSION_MIN_REQUIRED <= 1040 //Cmd+key are handled differently before 10.5 - (BOOL)performKeyEquivalent:(NSEvent *)theEvent { @@ -578,7 +578,7 @@ GHOST_WindowCocoa::GHOST_WindowCocoa( setDrawingContextType(type); updateDrawingContext(); activateDrawingContext(); -#if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7) // retina support started with 10.7.4 afaik +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 // retina support started with 10.7.4 afaik if (m_systemCocoa->m_nativePixel) { [m_openGLView setWantsBestResolutionOpenGLSurface:YES]; NSRect backingBounds = [m_openGLView convertRectToBacking:[m_openGLView bounds]]; @@ -928,7 +928,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state) * doesn't know view/window difference. */ m_fullScreen = true; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 //10.6 provides Cocoa functions to autoshow menu bar, and to change a window style //Hide menu & dock if needed if ([[m_window screen] isEqual:[[NSScreen screens] objectAtIndex:0]]) { @@ -987,7 +987,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state) m_fullScreen = false; //Exit fullscreen -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 //Show again menu & dock if needed if ([[m_window screen] isEqual:[NSScreen mainScreen]]) { [NSApp setPresentationOptions:NSApplicationPresentationDefault]; diff --git a/intern/itasc/kdl/chain.hpp b/intern/itasc/kdl/chain.hpp index fde9d4ed23e..1776737fc7d 100644 --- a/intern/itasc/kdl/chain.hpp +++ b/intern/itasc/kdl/chain.hpp @@ -36,7 +36,7 @@ namespace KDL { class Chain { private: #if defined(__APPLE__) -# if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_5 +# if MAC_OS_X_VERSION_MIN_REQUIRED <= 1050 std::vector segments; # else // Eigen allocator is needed for alignment of Eigen data types diff --git a/intern/itasc/kdl/tree.hpp b/intern/itasc/kdl/tree.hpp index a020c6cf2cf..82794f96b94 100644 --- a/intern/itasc/kdl/tree.hpp +++ b/intern/itasc/kdl/tree.hpp @@ -28,7 +28,7 @@ #include #include #if defined(__APPLE__) -# if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_5 +# if MAC_OS_X_VERSION_MIN_REQUIRED <= 1050 //no include # else # include @@ -42,7 +42,7 @@ namespace KDL //Forward declaration class TreeElement; #if defined(__APPLE__) -# if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_5 +# if MAC_OS_X_VERSION_MIN_REQUIRED <= 1050 typedef std::map SegmentMap; # else // Eigen allocator is needed for alignment of Eigen data types -- cgit v1.2.3