More work to clean up compiler warnings.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 05 Dec 2011 16:45:32 -0500
changeset 6105 3b06b03d74f4
parent 6104 e49364c8a253
child 6106 0209e1e113f2
More work to clean up compiler warnings.
src/video/cocoa/SDL_cocoamodes.m
--- a/src/video/cocoa/SDL_cocoamodes.m	Mon Dec 05 13:17:57 2011 -0500
+++ b/src/video/cocoa/SDL_cocoamodes.m	Mon Dec 05 16:45:32 2011 -0500
@@ -27,6 +27,22 @@
 /* we need this for ShowMenuBar() and HideMenuBar(). */
 #include <Carbon/Carbon.h>
 
+static inline void Cocoa_ToggleMenuBar(const BOOL show)
+{
+    /* !!! FIXME: keep an eye on this.
+     * ShowMenuBar/HideMenuBar is officially unavailable for 64-bit binaries.
+     *  It happens to work, as of 10.7, but we're going to see if
+     *  we can just simply do without it on newer OSes...
+     */
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070) && !defined(__LP64__)
+    if (show)
+        ShowMenuBar();
+    else
+        HideMenuBar();
+#endif
+}
+
+
 /* !!! FIXME: clean out the pre-10.6 code when it makes sense to do so. */
 #define FORCE_OLD_API 0 || (MAC_OS_X_VERSION_MAX_ALLOWED < 1060)
 
@@ -384,7 +400,7 @@
         }
 
         if (CGDisplayIsMain(displaydata->display)) {
-            ShowMenuBar();
+            Cocoa_ToggleMenuBar(YES);
         }
     } else {
         /* Put up the blanking window (a window above all other windows) */
@@ -408,7 +424,7 @@
 
         /* Hide the menu bar so it doesn't intercept events */
         if (CGDisplayIsMain(displaydata->display)) {
-            HideMenuBar();
+            Cocoa_ToggleMenuBar(NO);
         }
     }
 
@@ -453,7 +469,7 @@
         }
 
     }
-    ShowMenuBar();
+    Cocoa_ToggleMenuBar(YES);
 }
 
 #endif /* SDL_VIDEO_DRIVER_COCOA */