Skip to content
Snippets Groups Projects
Commit 5ad70e3f authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Mac hammering

parent 7f9d86b0
No related branches found
No related tags found
1 merge request!83Merge Linden 6.6.7
...@@ -28,6 +28,6 @@ ...@@ -28,6 +28,6 @@
#define LL_LLSYS_OBJC_H #define LL_LLSYS_OBJC_H
bool LLGetDarwinOSInfo(int &major, int &minor, int &patch); bool LLGetDarwinOSInfo(int &major, int &minor, int &patch);
const char* LLGetDarwinPreferredLanguage();
#endif // LL_LLSYS_OBJC_H #endif // LL_LLSYS_OBJC_H
...@@ -35,31 +35,15 @@ static int intAtStringIndex(NSArray *array, int index) ...@@ -35,31 +35,15 @@ static int intAtStringIndex(NSArray *array, int index)
bool LLGetDarwinOSInfo(int &major, int &minor, int &patch) bool LLGetDarwinOSInfo(int &major, int &minor, int &patch)
{ {
NSOperatingSystemVersion osVersion = [[NSProcessInfo processInfo] operatingSystemVersion]; NSOperatingSystemVersion osVersion = [[NSProcessInfo processInfo] operatingSystemVersion];
major = osVersion.majorVersion; major = (int)osVersion.majorVersion;
minor = osVersion.minorVersion; minor = (int)osVersion.minorVersion;
patch = osVersion.patchVersion; patch = (int)osVersion.patchVersion;
return true; return true;
} }
const char* LLGetDarwinPreferredLanguage() const char* LLGetDarwinPreferredLanguage()
{ {
NSString* lang = [[NSLocale preferredLanguages] objectAtIndex:0]; NSString* lang = [[NSLocale preferredLanguages] objectAtIndex:0];
const char* ret = [lang cStringUsingEncoding:NSASCIIStringEncoding]; const char* ret = [lang cStringUsingEncoding:NSASCIIStringEncoding];
@"/System/Library/CoreServices/SystemVersion.plist"] objectForKey:@"ProductVersion"];
NSArray* versions = [versionString componentsSeparatedByString:@"."];
NSUInteger count = [versions count];
if (count > 0)
{
major = intAtStringIndex(versions, 0);
if (count > 1)
{
minor = intAtStringIndex(versions, 1);
if (count > 2)
{
patch = intAtStringIndex(versions, 2);
}
}
}
}
return ret; return ret;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment