diff options
-rw-r--r-- | xbmc/osx/DarwinUtils.h | 1 | ||||
-rw-r--r-- | xbmc/osx/DarwinUtils.mm | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/xbmc/osx/DarwinUtils.h b/xbmc/osx/DarwinUtils.h index a6d2709649..292a9f18a9 100644 --- a/xbmc/osx/DarwinUtils.h +++ b/xbmc/osx/DarwinUtils.h @@ -34,6 +34,7 @@ extern "C" const char *getIosPlatformString(void); bool DarwinIsAppleTV2(void); bool DarwinIsMavericks(void); + bool DarwinIsSnowLeopard(void); bool DarwinHasRetina(void); const char *GetDarwinOSReleaseString(void); const char *GetDarwinVersionString(void); diff --git a/xbmc/osx/DarwinUtils.mm b/xbmc/osx/DarwinUtils.mm index a59044bbbd..0cd63cec95 100644 --- a/xbmc/osx/DarwinUtils.mm +++ b/xbmc/osx/DarwinUtils.mm @@ -43,6 +43,14 @@ #import "AutoPool.h" #import "DarwinUtils.h" +#ifndef NSAppKitVersionNumber10_5 +#define NSAppKitVersionNumber10_5 949 +#endif + +#ifndef NSAppKitVersionNumber10_6 +#define NSAppKitVersionNumber10_6 1038 +#endif + enum iosPlatform { iDeviceUnknown = -1, @@ -189,6 +197,19 @@ bool DarwinIsMavericks(void) return isMavericks == 1; } +bool DarwinIsSnowLeopard(void) +{ + static int isSnowLeopard = -1; +#if defined(TARGET_DARWIN_OSX) + if (isSnowLeopard == -1) + { + double appKitVersion = floor(NSAppKitVersionNumber); + isSnowLeopard = (appKitVersion <= NSAppKitVersionNumber10_6 && appKitVersion > NSAppKitVersionNumber10_5) ? 1 : 0; + } +#endif + return isSnowLeopard == 1; +} + bool DarwinHasRetina(void) { static enum iosPlatform platform = iDeviceUnknown; |