Fix runtime platform detection on Apple platforms

The watchOS and tvOS platforms also define __IPHONE_OS_VERSION_MIN_REQUIRED
for compatibility, so we need account for that in the ordering of the ifdefs.

Task-number: QTBUG-67534
Change-Id: Id86e684137550533470370ef29c3563d677d5865
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
bb10
Tor Arne Vestbø 2018-04-16 13:37:37 +02:00
parent 3697366642
commit a75f25a43f
1 changed files with 6 additions and 6 deletions

View File

@ -346,15 +346,15 @@ Qt::Key qt_mac_cocoaKey2QtKey(QChar keyCode)
void qt_apple_check_os_version()
{
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
const char *os = "iOS";
const int version = __IPHONE_OS_VERSION_MIN_REQUIRED;
#if defined(__WATCH_OS_VERSION_MIN_REQUIRED)
const char *os = "watchOS";
const int version = __WATCH_OS_VERSION_MIN_REQUIRED;
#elif defined(__TV_OS_VERSION_MIN_REQUIRED)
const char *os = "tvOS";
const int version = __TV_OS_VERSION_MIN_REQUIRED;
#elif defined(__WATCH_OS_VERSION_MIN_REQUIRED)
const char *os = "watchOS";
const int version = __WATCH_OS_VERSION_MIN_REQUIRED;
#elif defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
const char *os = "iOS";
const int version = __IPHONE_OS_VERSION_MIN_REQUIRED;
#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
const char *os = "macOS";
const int version = __MAC_OS_X_VERSION_MIN_REQUIRED;