diff options
author | Jake Petroules <jake.petroules@theqtcompany.com> | 2015-09-10 01:04:53 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@theqtcompany.com> | 2015-09-15 16:56:36 +0000 |
commit | 2d74c00a19a9e4909ff9f15248b9240dbddc2d22 (patch) | |
tree | 6a4f58abf8426704717c3420391d4309dce008ac /src/corelib/global | |
parent | 5081fd68870b71ba4f2a31cff475b0c46a75f364 (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')
-rw-r--r-- | src/corelib/global/qglobal.cpp | 16 | ||||
-rw-r--r-- | src/corelib/global/qsystemdetection.h | 28 |
2 files changed, 34 insertions, 10 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 3ede935b4b..775f62d2ae 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1169,7 +1169,7 @@ bool qSharedBuild() Q_DECL_NOTHROW \macro Q_OS_DARWIN \relates <QtGlobal> - Defined on Darwin-based operating systems such as OS X and iOS. + Defined on Darwin-based operating systems such as OS X, iOS, watchOS, and tvOS. */ /*! @@ -1187,6 +1187,20 @@ bool qSharedBuild() Q_DECL_NOTHROW */ /*! + \macro Q_OS_WATCHOS + \relates <QtGlobal> + + Defined on watchOS. + */ + +/*! + \macro Q_OS_TVOS + \relates <QtGlobal> + + Defined on tvOS. + */ + +/*! \macro Q_OS_WIN \relates <QtGlobal> 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 |