Index: src/video/cocoa/cocoa_v.mm =================================================================== --- src/video/cocoa/cocoa_v.mm (revision 11498) +++ src/video/cocoa/cocoa_v.mm (working copy) @@ -8,6 +8,7 @@ #ifdef WITH_COCOA +#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_3 #include #import @@ -233,9 +234,7 @@ static CocoaSubdriver *QZ_CreateWindowSubdriver(int width, int height, int bpp) { - long sysVersion; - - if (Gestalt(gestaltSystemVersion, &sysVersion) == noErr && sysVersion >= 0x1040) { + if (GetMacOSVersion() >= 0x1040) { return QZ_CreateWindowQuartzSubdriver(width, height, bpp); } Index: src/video/cocoa/wnd_quartz.mm =================================================================== --- src/video/cocoa/wnd_quartz.mm (revision 11498) +++ src/video/cocoa/wnd_quartz.mm (working copy) @@ -8,6 +8,7 @@ #ifdef WITH_COCOA +#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4 #include #import @@ -784,6 +785,11 @@ CocoaSubdriver *QZ_CreateWindowQuartzSubdriver(int width, int height, int bpp) { WindowQuartzSubdriver *ret; + + if (GetMacOSVersion() < 0x1040) { + DEBUG(driver, 0, "The cocoa quartz subdriver requires Mac OS X 10.4 or later."); + return NULL; + } if (bpp != 8 && bpp != 32) { DEBUG(driver, 0, "The cocoa quartz subdriver only supports 8 and 32 bpp."); Index: src/video/cocoa/event.mm =================================================================== --- src/video/cocoa/event.mm (revision 11498) +++ src/video/cocoa/event.mm (working copy) @@ -8,6 +8,9 @@ #ifdef WITH_COCOA +#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_3 +#include + #import #import /* gettimeofday */ #import /* for MAXPATHLEN */ Index: src/video/cocoa/fullscreen.mm =================================================================== --- src/video/cocoa/fullscreen.mm (revision 11498) +++ src/video/cocoa/fullscreen.mm (working copy) @@ -8,6 +8,7 @@ #ifdef WITH_COCOA +#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_3 #include #import Index: src/video/cocoa/wnd_quickdraw.mm =================================================================== --- src/video/cocoa/wnd_quickdraw.mm (revision 11498) +++ src/video/cocoa/wnd_quickdraw.mm (working copy) @@ -8,6 +8,8 @@ #ifdef WITH_COCOA +#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_3 +#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_3 #include #import @@ -802,6 +804,10 @@ CocoaSubdriver *QZ_CreateWindowQuickdrawSubdriver(int width, int height, int bpp) { WindowQuickdrawSubdriver *ret; + + if (GetMacOSVersion() >= 0x1040) { + DEBUG(driver, 0, "The cocoa quickdraw subdriver is not recommended for Mac OS X 10.4 or later."); + } if (bpp != 8 && bpp != 32) { DEBUG(driver, 0, "The cocoa quickdraw subdriver only supports 8 and 32 bpp."); Index: src/sound/cocoa_s.cpp =================================================================== --- src/sound/cocoa_s.cpp (revision 11498) +++ src/sound/cocoa_s.cpp (working copy) @@ -8,6 +8,9 @@ #ifdef WITH_COCOA +#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_3 +#include + #include /* Name conflict */ Index: src/music/qtmidi.cpp =================================================================== --- src/music/qtmidi.cpp (revision 11498) +++ src/music/qtmidi.cpp (working copy) @@ -19,6 +19,9 @@ */ +#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_3 +#include + /* * OpenTTD includes. */ Index: src/os/macosx/macos.h =================================================================== --- src/os/macosx/macos.h (revision 11498) +++ src/os/macosx/macos.h (working copy) @@ -15,6 +15,8 @@ void ShowMacAssertDialog ( const char *function, const char *file, const int line, const char *expression ); void ShowMacErrorDialog(const char *error); +long GetMacOSVersion(); + // Since MacOS X users will never see an assert unless they started the game from a terminal // we're using a custom assert(e) macro. #undef assert Index: src/os/macosx/macos.mm =================================================================== --- src/os/macosx/macos.mm (revision 11498) +++ src/os/macosx/macos.mm (working copy) @@ -1,5 +1,8 @@ /* $Id$ */ +#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_3 +#include + #include #include @@ -168,6 +171,20 @@ NSArray* languages = [defs objectForKey:@"AppleLanguages"]; NSString* preferredLang = [languages objectAtIndex:0]; /* preferredLang is either 2 or 5 characters long ("xx" or "xx_YY"). */ - [ preferredLang getCString:retbuf maxLength:32 encoding:NSASCIIStringEncoding ]; + if (GetMacOSVersion() < 0x1040) { + [ preferredLang getCString:retbuf maxLength:32 ]; + } else { + [ preferredLang getCString:retbuf maxLength:32 encoding:NSASCIIStringEncoding ]; + } return retbuf; } + + +long GetMacOSVersion() +{ + long sysVersion; + + if (Gestalt(gestaltSystemVersion, &sysVersion) != noErr) return -1; + + return sysVersion; +}