Remove use of MAC_OS_X_VERSION_10_x macro. SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Thu, 25 Aug 2011 03:04:24 -0400
branchSDL-1.2
changeset 5645 80e036f88a6e
parent 5639 72659c5c8616
child 5648 0d28cf898765
Remove use of MAC_OS_X_VERSION_10_x macro. If you look for MAC_OS_X_VERSION_10_6 in the 10.4 SDK (for example), it'll fail to do the right thing in the preprocessor.
src/video/quartz/SDL_QuartzVideo.m
--- a/src/video/quartz/SDL_QuartzVideo.m	Tue Aug 23 06:04:54 2011 -0400
+++ b/src/video/quartz/SDL_QuartzVideo.m	Thu Aug 25 03:04:24 2011 -0400
@@ -24,8 +24,8 @@
 #include "SDL_QuartzVideo.h"
 #include "SDL_QuartzWindow.h"
 
-/* Fixed in Snow Leopard */
-#if __MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1060  /* Fixed in Snow Leopard */
 /*
     Add methods to get at private members of NSScreen. 
     Since there is a bug in Apple's screen switching code
@@ -104,7 +104,7 @@
 
 #if FORCE_OLD_API
 #undef MAC_OS_X_VERSION_MIN_REQUIRED
-#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_5
+#define MAC_OS_X_VERSION_MIN_REQUIRED 1050
 #endif
 
 static inline BOOL IS_SNOW_LEOPARD_OR_LATER(_THIS)
@@ -119,7 +119,7 @@
 static void QZ_ReleaseDisplayMode(_THIS, const void *moderef)
 {
     /* we only own these references in the 10.6+ API. */
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
     if (IS_SNOW_LEOPARD_OR_LATER(this)) {
         CGDisplayModeRelease((CGDisplayModeRef) moderef);
     }
@@ -129,7 +129,7 @@
 static void QZ_ReleaseDisplayModeList(_THIS, CFArrayRef mode_list)
 {
     /* we only own these references in the 10.6+ API. */
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
     if (IS_SNOW_LEOPARD_OR_LATER(this)) {
         CFRelease(mode_list);
     }
@@ -231,7 +231,7 @@
         return;
     }
 
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
     if (IS_SNOW_LEOPARD_OR_LATER(this)) {
         CGDisplayModeRef vidmode = (CGDisplayModeRef) _mode;
         CFStringRef fmt = CGDisplayModeCopyPixelEncoding(vidmode);
@@ -249,7 +249,7 @@
     }
 #endif
 
-#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1060)
     if (!IS_SNOW_LEOPARD_OR_LATER(this)) {
         CFDictionaryRef vidmode = (CFDictionaryRef) _mode;
         CFNumberGetValue (
@@ -296,13 +296,13 @@
     }
 #endif
 
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
     if (IS_SNOW_LEOPARD_OR_LATER(this)) {
         save_mode = CGDisplayCopyDisplayMode(display_id);
     }
 #endif
 
-#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1060)
     if (!IS_SNOW_LEOPARD_OR_LATER(this)) {
         save_mode = CGDisplayCurrentMode(display_id);
     }
@@ -380,13 +380,13 @@
         client_mode_list = NULL;
     }
 
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
     if (IS_SNOW_LEOPARD_OR_LATER(this)) {
         mode_list = CGDisplayCopyAllDisplayModes(display_id, NULL);
     }
 #endif
 
-#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1060)
     if (!IS_SNOW_LEOPARD_OR_LATER(this)) {
         mode_list = CGDisplayAvailableModes(display_id);
     }
@@ -484,13 +484,13 @@
 
 static CGError QZ_SetDisplayMode(_THIS, const void *vidmode)
 {
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
     if (IS_SNOW_LEOPARD_OR_LATER(this)) {
         return CGDisplaySetDisplayMode(display_id, (CGDisplayModeRef) vidmode, NULL);
     }
 #endif
 
-#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1060)
     if (!IS_SNOW_LEOPARD_OR_LATER(this)) {
         return CGDisplaySwitchToMode(display_id, (CFDictionaryRef) vidmode);
     }
@@ -576,7 +576,7 @@
         return NULL;
     }
 
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
     if (IS_SNOW_LEOPARD_OR_LATER(this)) {
         /* apparently, we have to roll our own now. :/ */
         CFArrayRef mode_list = CGDisplayCopyAllDisplayModes(display_id, NULL);
@@ -600,7 +600,7 @@
     }
 #endif
 
-#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1060)
     if (!IS_SNOW_LEOPARD_OR_LATER(this)) {
         boolean_t exact = 0;
         best = CGDisplayBestModeForParameters(display_id, bpp, w, h, &exact);