summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qprocessordetection.h
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-02-19 10:06:25 +0100
committerOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-02-19 10:06:25 +0100
commit30fd22b9574def54726e7b193127cc0c901c1b4c (patch)
tree96dfc923044db0515064ba39d052d9ed577e3e40 /src/corelib/global/qprocessordetection.h
parentd7b0581c1c2ef60c08d238dae39298af6904918f (diff)
parent6aa09bbce59828d028f6d1e81d2bfc6ba537aae1 (diff)
Merge remote-tracking branch 'origin/dev' into stable
Diffstat (limited to 'src/corelib/global/qprocessordetection.h')
-rw-r--r--src/corelib/global/qprocessordetection.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h
index 623e30aa06..cf7ee1b7aa 100644
--- a/src/corelib/global/qprocessordetection.h
+++ b/src/corelib/global/qprocessordetection.h
@@ -196,6 +196,7 @@
# define Q_PROCESSOR_X86 6
# define Q_PROCESSOR_X86_64
# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
+# define Q_PROCESSOR_WORDSIZE 8
/*
Itanium (IA-64) family, no revisions or variants
@@ -204,6 +205,7 @@
*/
#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
# define Q_PROCESSOR_IA64
+# define Q_PROCESSOR_WORDSIZE 8
// Q_BYTE_ORDER not defined, use endianness auto-detection
/*
@@ -324,4 +326,22 @@
# endif
#endif
+/*
+ Define Q_PROCESSOR_WORDSIZE to be the size of the machine's word (usually,
+ the size of the register). On some architectures where a pointer could be
+ smaller than the register, the macro is defined above.
+
+ Falls back to QT_POINTER_SIZE if not set explicitly for the platform.
+*/
+#ifndef Q_PROCESSOR_WORDSIZE
+# ifdef __SIZEOF_POINTER__
+ /* GCC & friends define this */
+# define Q_PROCESSOR_WORDSIZE __SIZEOF_POINTER__
+# elif defined(_LP64) || defined(__LP64__) || defined(WIN64) || defined(_WIN64)
+# define Q_PROCESSOR_WORDSIZE 8
+# else
+# define Q_PROCESSOR_WORDSIZE QT_POINTER_SIZE
+# endif
+#endif
+
#endif // QPROCESSORDETECTION_H