diff options
author | Memphiz <memphis@machzwo.de> | 2014-06-11 15:27:24 +0200 |
---|---|---|
committer | Memphiz <memphis@machzwo.de> | 2014-06-15 16:23:10 +0200 |
commit | 1ac322896f275ad6712332f56de46aabb812e8ee (patch) | |
tree | 102b7ecab71086c8b8a75162cabe5134d5e3502a | |
parent | 741d6146aab7d9bd7d76a3a2e8c2ad49d1f91c8f (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 e1a16116f1..02f0c19038 100644 --- a/xbmc/osx/DarwinUtils.h +++ b/xbmc/osx/DarwinUtils.h @@ -33,6 +33,7 @@ extern "C" #endif 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 0637720709..6a7c659b9f 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, @@ -170,6 +178,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; |