Introduce macros for simplifying platform checks on Mac OS and iOS

Change-Id: Ibab8486e1e6d7e4d8922fce96add055e60c6095c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Tor Arne Vestbø 2013-02-16 17:31:58 +01:00 committed by The Qt Project
parent 4e78ce288a
commit f2191d9900
2 changed files with 12 additions and 2 deletions

View File

@ -512,6 +512,16 @@ template <typename T>
Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max)
{ return qMax(min, qMin(max, val)); }
#ifdef Q_OS_DARWIN
# define QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(osx, ios) \
(defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= osx) || \
(defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= ios)
# define QT_MAC_DEPLOYMENT_TARGET_BELOW(osx, ios) \
(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && osx != __MAC_NA && __MAC_OS_X_VERSION_MIN_REQUIRED < osx) || \
(defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && ios != __IPHONE_NA && __IPHONE_OS_VERSION_MIN_REQUIRED < ios)
#endif
/*
Data stream functions are provided by many classes (defined in qdatastream.h)
*/

View File

@ -361,9 +361,9 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo
static QHash<QString, QStringList> fallbackLists;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 60000
#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_NA, __IPHONE_6_0)
// CTFontCopyDefaultCascadeListForLanguages is available in the SDK
#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 60000)
#if QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_NA, __IPHONE_6_0)
// But we have to feature check at runtime
if (&CTFontCopyDefaultCascadeListForLanguages)
#endif