chore(cocoa): Remove Gestalt compiler warnings for macOS 10.13+
This commit is contained in:
parent
3919ac7c7d
commit
98e6adcfca
|
@ -292,6 +292,12 @@ static void frontend_darwin_get_os(char *s, size_t len, int *major, int *minor)
|
||||||
get_ios_version(major, minor);
|
get_ios_version(major, minor);
|
||||||
strlcpy(s, "iOS", len);
|
strlcpy(s, "iOS", len);
|
||||||
#elif defined(OSX)
|
#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)])
|
if ([[NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion)])
|
||||||
{
|
{
|
||||||
typedef struct
|
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(gestaltSystemVersionMinor, (SInt32*)minor);
|
||||||
Gestalt(gestaltSystemVersionMajor, (SInt32*)major);
|
Gestalt(gestaltSystemVersionMajor, (SInt32*)major);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
strlcpy(s, "OSX", len);
|
strlcpy(s, "OSX", len);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue