summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorTor Arne Vestbø <torarnv@gmail.com>2013-02-16 17:16:53 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-18 00:32:31 +0100
commit4e78ce288aa67caddea65cd070663e95dc4f7183 (patch)
treec4663285e6be4f159b5daf22f904498c90f1488b /src/corelib
parent193e3ba32e0c808b48216d9d96aa88e591dd189f (diff)
Start using Availability.h over AvailabilityMacros.h on Mac OS
The former was introduced with Mac OS 10.6 and can also be used for checking iOS versions, so it's preferable. We still include the old availability header, and use it in various places in Qt, and so does the Mac OS frameworks, so there's no need to phase it out, but for new platform checks we want to use the updated macros of the form: #if __MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_7 Ideally you should not use the named version macro, and use 1070 instead, in case you build against an SDK that does not define the named version yet, but we take care of defining these in qsystemdetection.h for convenience. Change-Id: I9cfa72e37816583f28ff9643793f111e155b7789 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qsystemdetection.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h
index f8a61962ec..eb7aa2e64f 100644
--- a/src/corelib/global/qsystemdetection.h
+++ b/src/corelib/global/qsystemdetection.h
@@ -175,31 +175,34 @@
#endif
#ifdef Q_OS_DARWIN
+# include <Availability.h>
+# if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6
+# undef __MAC_OS_X_VERSION_MIN_REQUIRED
+# define __MAC_OS_X_VERSION_MIN_REQUIRED __MAC_10_6
+# endif
# include <AvailabilityMacros.h>
# if !defined(MAC_OS_X_VERSION_MIN_REQUIRED) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
# undef MAC_OS_X_VERSION_MIN_REQUIRED
# define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6
# endif
#
-# if !defined(MAC_OS_X_VERSION_10_3)
-# define MAC_OS_X_VERSION_10_3 MAC_OS_X_VERSION_10_2 + 1
-# endif
-# if !defined(MAC_OS_X_VERSION_10_4)
-# define MAC_OS_X_VERSION_10_4 MAC_OS_X_VERSION_10_3 + 1
-# endif
-# if !defined(MAC_OS_X_VERSION_10_5)
-# define MAC_OS_X_VERSION_10_5 MAC_OS_X_VERSION_10_4 + 1
+# // Numerical checks are preferred to named checks, but to be safe
+# // we define the missing version names in case Qt uses them.
+#
+# if !defined(__MAC_10_7)
+# define __MAC_10_7 1070
# endif
-# if !defined(MAC_OS_X_VERSION_10_6)
-# define MAC_OS_X_VERSION_10_6 MAC_OS_X_VERSION_10_5 + 1
+# if !defined(__MAC_10_8)
+# define __MAC_10_8 1080
# endif
# if !defined(MAC_OS_X_VERSION_10_7)
-# define MAC_OS_X_VERSION_10_7 MAC_OS_X_VERSION_10_6 + 1
+# define MAC_OS_X_VERSION_10_7 1070
# endif
# if !defined(MAC_OS_X_VERSION_10_8)
-# define MAC_OS_X_VERSION_10_8 MAC_OS_X_VERSION_10_7 + 1
+# define MAC_OS_X_VERSION_10_8 1080
# endif
-# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_8)
+#
+# if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_8)
# warning "This version of Mac OS X is unsupported"
# endif
#endif