aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlprivate.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2014-12-01 13:11:03 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-12-03 08:28:42 +0100
commit1a764d00ee56fe02a708bc057acddf03408ba303 (patch)
tree602a37a28892812ec6a6048fb1ddc89cb2361aaf /src/qml/qml/qqmlprivate.h
parenta6fbea98ed3c2cce4bd1b2d4ec2dc055b4eaf129 (diff)
Fix application build when combining with Mac OS X Cocoa headers
OSX's AssertMacros.h unconditionally defines macros like "check" and that clashes with qml's type discovery templates that define a check function and that are used by qmlRegisterType and friends. There's a comment in the OS X headers suggesting that this will be fixed in the "next" release, but that hasn't happened for a while and the bug is still present in 10.10. So let's work around it and make life easier for people using Qml and Cocoa at the same time. Change-Id: I005d21188f92deaebd45bce2e6484cd4deeb9a34 Task-number: QTBUG-36309 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlprivate.h')
-rw-r--r--src/qml/qml/qqmlprivate.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h
index 29d2bc6193..dfbf04a50f 100644
--- a/src/qml/qml/qqmlprivate.h
+++ b/src/qml/qml/qqmlprivate.h
@@ -122,12 +122,12 @@ namespace QQmlPrivate
typedef int yes_type;
typedef char no_type;
- static yes_type check(To *);
- static no_type check(...);
+ static yes_type checkType(To *);
+ static no_type checkType(...);
static inline int cast()
{
- return StaticCastSelectorClass<From, To, sizeof(check(reinterpret_cast<From *>(0)))>::cast();
+ return StaticCastSelectorClass<From, To, sizeof(checkType(reinterpret_cast<From *>(0)))>::cast();
}
};
@@ -145,10 +145,10 @@ namespace QQmlPrivate
typedef char no_type;
template<typename ReturnType>
- static yes_type check(ReturnType *(*)(QObject *));
- static no_type check(...);
+ static yes_type checkType(ReturnType *(*)(QObject *));
+ static no_type checkType(...);
- static bool const value = sizeof(check(&T::qmlAttachedProperties)) == sizeof(yes_type);
+ static bool const value = sizeof(checkType(&T::qmlAttachedProperties)) == sizeof(yes_type);
};
template <typename T>