aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4global_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-19 22:44:14 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-20 05:55:25 +0200
commit3ef88c539ff63d9cb33af71f44653b328f36d0db (patch)
tree207bd2f78b4d9614bd10f1949d27d9c711786d81 /src/qml/jsruntime/qv4global_p.h
parent8ed38c70fd29680f7981d9d23581d46cf32139d0 (diff)
Use a handwritten offsetof macro
clang complains about our usage of offsetof(). What we do is not strictly c++98 compliant, but compliant with c++11. So replace the default offsetof with a handwritten macro to shut up clang until we can switch to c++11 mode for all compilers. Change-Id: Id724adb323ba9724ad5d7d9e0dba5a73b51af24f Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Diffstat (limited to 'src/qml/jsruntime/qv4global_p.h')
-rw-r--r--src/qml/jsruntime/qv4global_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h
index f610811ddf..096187d91f 100644
--- a/src/qml/jsruntime/qv4global_p.h
+++ b/src/qml/jsruntime/qv4global_p.h
@@ -62,6 +62,8 @@ inline bool signbit(double d) { return _copysign(1.0, d) < 0; }
inline double trunc(double d) { return d > 0 ? floor(d) : ceil(d); }
#endif
+#define qOffsetOf(s, m) ((size_t)((((char *)&(((s *)64)->m)) - 64)))
+
#if defined(Q_OS_QNX)
#include <math.h>
#undef isnan