chore(cocoa): Remove Gestalt compiler warnings for macOS 10.13+

This commit is contained in:
Stuart Carnie 2018-11-05 06:52:31 -07:00
parent 3919ac7c7d
commit 98e6adcfca
No known key found for this signature in database
GPG Key ID: 848D9C9718D78B4F

View File

@ -292,6 +292,12 @@ static void frontend_darwin_get_os(char *s, size_t len, int *major, int *minor)
get_ios_version(major, minor);
strlcpy(s, "iOS", len);
#elif defined(OSX)
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 // MAC_OS_X_VERSION_10_13
NSOperatingSystemVersion version = NSProcessInfo.processInfo.operatingSystemVersion;
*major = (int)version.majorVersion;
*minor = (int)version.minorVersion;
#else
if ([[NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion)])
{
typedef struct
@ -309,6 +315,7 @@ static void frontend_darwin_get_os(char *s, size_t len, int *major, int *minor)
Gestalt(gestaltSystemVersionMinor, (SInt32*)minor);
Gestalt(gestaltSystemVersionMajor, (SInt32*)major);
}
#endif
strlcpy(s, "OSX", len);
#endif
}