diff --git a/src/os/macosx/osx_stdafx.h b/src/os/macosx/osx_stdafx.h index 688762b..decd0ba 100644 --- a/src/os/macosx/osx_stdafx.h +++ b/src/os/macosx/osx_stdafx.h @@ -75,4 +75,9 @@ typedef unsigned int NSUInteger; #endif /* __LP64__ */ #endif /* NSInteger */ +/* OS X SDK versions >= 10.5 have a non-const iconv. */ +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +# define HAVE_NON_CONST_ICONV +#endif + #endif /* MACOS_STDAFX_H */ diff --git a/src/video/cocoa/wnd_quartz.mm b/src/video/cocoa/wnd_quartz.mm index 5d45dcb..a6c9e12 100644 --- a/src/video/cocoa/wnd_quartz.mm +++ b/src/video/cocoa/wnd_quartz.mm @@ -240,12 +240,12 @@ void WindowQuartzSubdriver::GetDeviceInfo() */ bool WindowQuartzSubdriver::ToggleFullscreen() { -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) - [this->window toggleFullScreen:this->window]; - return true; -#else + if ([ this->window respondsToSelector:@selector(toggleFullScreen:) ]) { + [ this->window performSelector:@selector(toggleFullScreen:) withObject:this->window ]; + return true; + } + return false; -#endif } bool WindowQuartzSubdriver::SetVideoMode(int width, int height, int bpp) @@ -280,26 +280,22 @@ bool WindowQuartzSubdriver::SetVideoMode(int width, int height, int bpp) return false; } +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 /* Add built in full-screen support when available (OS X 10.7 and higher) * This code actually compiles for 10.5 and later, but only makes sense in conjunction * with the quartz fullscreen support as found only in 10.7 and later */ -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) if ([this->window respondsToSelector:@selector(toggleFullScreen:)]) { - /* Constants needed to build on pre-10.7 systems. Source: NSWindow documentation. */ + /* Constants needed to build on pre-10.7 SDKs. Source: NSWindow documentation. */ const int NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7; const int NSWindowFullScreenButton = 7; - NSWindowCollectionBehavior behavior = [this->window collectionBehavior]; - behavior |= NSWindowCollectionBehaviorFullScreenPrimary; - [window setCollectionBehavior:behavior]; - NSButton* fullscreenButton = - [this->window standardWindowButton:NSWindowFullScreenButton]; - [fullscreenButton setAction:@selector(toggleFullScreen:)]; - [fullscreenButton setTarget:this->window]; + [ this->window standardWindowButton:NSWindowFullScreenButton ]; + [ fullscreenButton setAction:@selector(toggleFullScreen:) ]; + [ fullscreenButton setTarget:this->window ]; - [this->window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenPrimary]; + [ this->window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary ]; } #endif