diff options
author | Ryan C. Gordon <icculus@icculus.org> | 2011-12-05 16:45:32 -0500 |
---|---|---|
committer | Ryan C. Gordon <icculus@icculus.org> | 2011-12-05 16:45:32 -0500 |
commit | 97532b1eb051d065ebcf6fb8fc44665ff4088bd7 (patch) | |
tree | b00f9d60bef346df4d425f4e77f54ee31a201fff /src | |
parent | 51e4184ddcf17476b740e752586488a3a26667c6 (diff) |
More work to clean up compiler warnings.
Diffstat (limited to 'src')
-rw-r--r-- | src/video/cocoa/SDL_cocoamodes.m | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/video/cocoa/SDL_cocoamodes.m b/src/video/cocoa/SDL_cocoamodes.m index 98c6e332..cc266590 100644 --- a/src/video/cocoa/SDL_cocoamodes.m +++ b/src/video/cocoa/SDL_cocoamodes.m @@ -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 @@ Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) } if (CGDisplayIsMain(displaydata->display)) { - ShowMenuBar(); + Cocoa_ToggleMenuBar(YES); } } else { /* Put up the blanking window (a window above all other windows) */ @@ -408,7 +424,7 @@ Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) /* Hide the menu bar so it doesn't intercept events */ if (CGDisplayIsMain(displaydata->display)) { - HideMenuBar(); + Cocoa_ToggleMenuBar(NO); } } @@ -453,7 +469,7 @@ Cocoa_QuitModes(_THIS) } } - ShowMenuBar(); + Cocoa_ToggleMenuBar(YES); } #endif /* SDL_VIDEO_DRIVER_COCOA */ |