Add Q_OS_OSX and update the documentation to reflect usage intent.

Change-Id: I7f089109d7357995b65f6a012f705a6c3cac12ff
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
Jake Petroules 2013-07-01 09:12:57 -04:00 committed by The Qt Project
parent ffef22cae2
commit eb8216dd4a
2 changed files with 12 additions and 9 deletions

View File

@ -934,7 +934,7 @@ bool qSharedBuild() Q_DECL_NOTHROW
\endlist
Some constants are defined only on certain platforms. You can use
the preprocessor symbols Q_OS_WIN and Q_OS_MACX to test that
the preprocessor symbols Q_OS_WIN and Q_OS_OSX to test that
the application is compiled under Windows or OS X.
\sa QLibraryInfo
@ -1077,18 +1077,20 @@ bool qSharedBuild() Q_DECL_NOTHROW
\macro Q_OS_DARWIN
\relates <QtGlobal>
Defined on Darwin OS (synonym for Q_OS_MAC).
Defined on Darwin-based operating systems such as OS X and iOS,
including any open source version(s) of Darwin.
*/
/*!
\macro Q_OS_MAC
\relates <QtGlobal>
Defined on OS X and iOS (synonym for Q_OS_DARWIN).
Defined on Darwin-based operating systems distributed by Apple, which
currently includes OS X and iOS, but not the open source version.
*/
/*!
\macro Q_OS_MACX
\macro Q_OS_OSX
\relates <QtGlobal>
Defined on OS X.

View File

@ -49,9 +49,9 @@
/*
The operating system, must be one of: (Q_OS_x)
DARWIN - Darwin OS (synonym for Q_OS_MAC)
MAC - OS X or iOS (synonym for Q_OS_DARWIN)
MACX - OS X
DARWIN - Any Darwin system
MAC - OS X and iOS
OSX - OS X
IOS - iOS
MSDOS - MS-DOS and Windows
OS2 - OS/2
@ -175,8 +175,9 @@
# include <TargetConditionals.h>
# if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
# define Q_OS_IOS
# else
# define Q_OS_MACX
# elif defined(TARGET_OS_MAC) && TARGET_OS_MAC
# define Q_OS_OSX
# define Q_OS_MACX // compatibility synonym
# endif
#endif