From bf10f2be19640bc398cd38b1fefcf58d4dcecd68 Mon Sep 17 00:00:00 2001
From: Jake Petroules <jake.petroules@petroules.com>
Date: Wed, 8 May 2013 08:06:36 -0400
Subject: [PATCH] Repurpose the former Q_OS_MAC synonym "Q_OS_MACX" to mean "OS
 X".
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The equivalent was done earlier for qmake, and this will enable
developers writing OS X-specific code to use #ifdef Q_OS_MACX as
opposed to overly verbose #if defined(Q_OS_MAC) && !defined(Q_OS_IOS).

The sole usage of Q_OS_MACX within qtbase has been changed to the
now appropriate value and documentation has been updated.

Change-Id: I2c59eea02e94b691b705170b2f96a97940fdc756
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
---
 src/corelib/global/qglobal.cpp        | 32 +++++++++++++++++++--------
 src/corelib/global/qsystemdetection.h |  8 ++++---
 src/corelib/tools/qsharedpointer.cpp  |  2 +-
 3 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 9995daf1e92..40a2e2aeec6 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -928,8 +928,8 @@ 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_MAC to test that
-    the application is compiled under Windows or Mac.
+    the preprocessor symbols Q_OS_WIN and Q_OS_MACX to test that
+    the application is compiled under Windows or OS X.
 
     \sa QLibraryInfo
 */
@@ -1072,6 +1072,27 @@ bool qSharedBuild() Q_DECL_NOTHROW
     Defined on Darwin OS (synonym for Q_OS_MAC).
 */
 
+/*!
+    \macro Q_OS_MAC
+    \relates <QtGlobal>
+
+    Defined on OS X and iOS (synonym for Q_OS_DARWIN).
+ */
+
+/*!
+    \macro Q_OS_MACX
+    \relates <QtGlobal>
+
+    Defined on OS X.
+ */
+
+/*!
+    \macro Q_OS_IOS
+    \relates <QtGlobal>
+
+    Defined on iOS.
+ */
+
 /*!
     \macro Q_OS_WIN
     \relates <QtGlobal>
@@ -1394,13 +1415,6 @@ bool qSharedBuild() Q_DECL_NOTHROW
     Optimizing C++ Compilers.
 */
 
-/*!
-  \macro Q_OS_MAC
-  \relates <QtGlobal>
-
-  Defined on MAC OS (synonym for Darwin).
- */
-
 /*!
     \macro Q_PROCESSOR_ALPHA
     \relates <QtGlobal>
diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h
index 0caac3d7970..690442d0661 100644
--- a/src/corelib/global/qsystemdetection.h
+++ b/src/corelib/global/qsystemdetection.h
@@ -50,8 +50,9 @@
    The operating system, must be one of: (Q_OS_x)
 
      DARWIN   - Darwin OS (synonym for Q_OS_MAC)
-     MAC      - Mac OS X or iOS (iPhoneOS)
-     IOS      - iOS (treated as a variant of Mac OS)
+     MAC      - OS X or iOS (synonym for Q_OS_DARWIN)
+     MACX     - OS X
+     IOS      - iOS
      MSDOS    - MS-DOS and Windows
      OS2      - OS/2
      OS2EMX   - XFree86 on OS/2 (not PM)
@@ -166,7 +167,6 @@
 
 #if defined(Q_OS_DARWIN)
 #  define Q_OS_MAC
-#  define Q_OS_MACX /* Q_OS_MACX is only for compatibility.*/
 #  if defined(Q_OS_DARWIN64)
 #     define Q_OS_MAC64
 #  elif defined(Q_OS_DARWIN32)
@@ -175,6 +175,8 @@
 #  include <TargetConditionals.h>
 #  if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
 #     define Q_OS_IOS
+#  else
+#     define Q_OS_MACX
 #  endif
 #endif
 
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index bced1f4ece0..ef626213863 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -1279,7 +1279,7 @@ QT_END_NAMESPACE
 #  ifdef QT_SHARED_POINTER_BACKTRACE_SUPPORT
 #    if defined(__GLIBC__) && (__GLIBC__ >= 2) && !defined(__UCLIBC__) && !defined(QT_LINUXBASE)
 #      define BACKTRACE_SUPPORTED
-#    elif defined(Q_OS_MACX)
+#    elif defined(Q_OS_MAC)
 #      define BACKTRACE_SUPPORTED
 #    endif
 #  endif
-- 
GitLab