Fix processor detection for MSVC ARM compiler (WEC7).
authorJanne Anttila <janne.anttila@digia.com>
Thu, 9 Aug 2012 05:52:39 +0000 (08:52 +0300)
committerQt by Nokia <qt-info@nokia.com>
Mon, 20 Aug 2012 14:58:23 +0000 (16:58 +0200)
Visual Studio compiler defines _M_ARM preprocessor variable when
compiling for ARM and the value of preprocessor variable indicates the
supported instruction set.

For more information see:
http://msdn.microsoft.com/en-us/library/gg155713.aspx

Change-Id: I54137257b83f64fdf03bf7df9995e08d16dff4df
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/global/qprocessordetection.h

index f030f64..cc6500c 100644 (file)
     ARM is bi-endian, detect using __ARMEL__ or __ARMEB__, falling back to
     auto-detection implemented below.
 */
-#if defined(__arm__) || defined(__TARGET_ARCH_ARM)
+#if defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_M_ARM)
 #  define Q_PROCESSOR_ARM
 #  if defined(__ARM_ARCH_7__) \
       || defined(__ARM_ARCH_7A__) \
       || defined(__ARM_ARCH_7R__) \
       || defined(__ARM_ARCH_7M__) \
-      || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7)
+      || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7) \
+      || (defined(_M_ARM) && _M_ARM-0 >= 7)
 #    define Q_PROCESSOR_ARM_V7
 #    define Q_PROCESSOR_ARM_V6
 #    define Q_PROCESSOR_ARM_V5
       || defined(__ARM_ARCH_6K__) \
       || defined(__ARM_ARCH_6ZK__) \
       || defined(__ARM_ARCH_6M__) \
-      || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6)
+      || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6) \
+      || (defined(_M_ARM) && _M_ARM-0 >= 6)
 #    define Q_PROCESSOR_ARM_V6
 #    define Q_PROCESSOR_ARM_V5
 #  elif defined(__ARM_ARCH_5TEJ__) \
-        || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5)
+        || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5) \
+        || (defined(_M_ARM) && _M_ARM-0 >= 5)
 #    define Q_PROCESSOR_ARM_V5
 #  endif
 #  if defined(__ARMEL__)