summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qsystemdetection.h
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@theqtcompany.com>2015-09-10 01:04:53 -0700
committerJake Petroules <jake.petroules@theqtcompany.com>2015-09-15 16:56:36 +0000
commit2d74c00a19a9e4909ff9f15248b9240dbddc2d22 (patch)
tree6a4f58abf8426704717c3420391d4309dce008ac /src/corelib/global/qsystemdetection.h
parent5081fd68870b71ba4f2a31cff475b0c46a75f364 (diff)
Introduce Q_OS macros for watchOS and tvOS.
As a useful side effect, watchOS and tvOS won't be detected as iOS, leading to another confusing Q_OS_MAC situation. Change-Id: I00fc0c7088dbc091c4638b6937a7b378d7569cec Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Diffstat (limited to 'src/corelib/global/qsystemdetection.h')
-rw-r--r--src/corelib/global/qsystemdetection.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h
index 6d942a7217..8711678f34 100644
--- a/src/corelib/global/qsystemdetection.h
+++ b/src/corelib/global/qsystemdetection.h
@@ -41,9 +41,11 @@
/*
The operating system, must be one of: (Q_OS_x)
- DARWIN - Any Darwin system (OS X, iOS)
+ DARWIN - Any Darwin system (OS X, iOS, watchOS, tvOS)
OSX - OS X
IOS - iOS
+ WATCHOS - watchOS
+ TVOS - tvOS
MSDOS - MS-DOS and Windows
OS2 - OS/2
OS2EMX - XFree86 on OS/2 (not PM)
@@ -88,15 +90,23 @@
#if defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__))
# include <TargetConditionals.h>
# if defined(TARGET_OS_MAC) && TARGET_OS_MAC
-# define Q_OS_DARWIN
-# define Q_OS_BSD4
-# ifdef __LP64__
-# define Q_OS_DARWIN64
-# else
-# define Q_OS_DARWIN32
-# endif
+# define Q_OS_DARWIN
+# define Q_OS_BSD4
+# ifdef __LP64__
+# define Q_OS_DARWIN64
+# else
+# define Q_OS_DARWIN32
+# endif
# if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
-# define Q_OS_IOS
+# if defined(TARGET_OS_TV) && TARGET_OS_TV
+# define Q_OS_TVOS
+# elif defined(TARGET_OS_WATCH) && TARGET_OS_WATCH
+# define Q_OS_WATCHOS
+# else
+# // TARGET_OS_IOS is only available in newer SDKs,
+# // so assume any other iOS-based platform is iOS for now
+# define Q_OS_IOS
+# endif
# else
# // there is no "real" OS X define (rdar://22640089),
# // assume any non iOS-based platform is OS X for now