Wrap legacy APIs in a QT_MAC_DEPLOYMENT_TARGET_BELOW macro.

If the deployment target is OS X >= 10.10 or iOS >= 8.0, we always have
the NSProcessInfo API available and do not need to compile-in this code
at all.

Change-Id: I8470a5be475a82e7b88d62f4558925f62527b6f6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
bb10
Jake Petroules 2016-02-14 02:00:39 -08:00
parent 34472e946a
commit de82352d28
1 changed files with 2 additions and 0 deletions

View File

@ -107,6 +107,7 @@ QAppleOperatingSystemVersion qt_apple_os_version()
// Use temporary variables so we can return 0.0.0 (unknown version)
// in case of an error partway through determining the OS version
qint32 major = 0, minor = 0, patch = 0;
#if QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_10_10, __IPHONE_8_0)
#if defined(Q_OS_IOS)
@autoreleasepool {
NSArray *parts = [UIDevice.currentDevice.systemVersion componentsSeparatedByString:@"."];
@ -129,6 +130,7 @@ QAppleOperatingSystemVersion qt_apple_os_version()
return v;
if (pGestalt('sys3', &patch) != 0)
return v;
#endif
#endif
v.major = major;
v.minor = minor;