diff options
author | Memphiz <memphis@machzwo.de> | 2014-06-11 15:27:24 +0200 |
---|---|---|
committer | Memphiz <memphis@machzwo.de> | 2014-06-11 15:27:24 +0200 |
commit | 51f50bb404ddcf27dccd7e40249753e7382a2d0d (patch) | |
tree | bd32722ca7dd125e26a2864b32d83298c4158de0 | |
parent | 603c7faccf084b41713dea6c377681761a0aa075 (diff) |
[osx] - add function for identifying osx snow leopard runtime
-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; |