From 3ef95347feef61a9d3d36763bb8dc65217827922 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Thu, 9 Aug 2012 08:52:39 +0300 Subject: Fix processor detection for MSVC ARM compiler (WEC7). 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 Reviewed-by: Thiago Macieira --- src/corelib/global/qprocessordetection.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/corelib/global/qprocessordetection.h') diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h index f030f64443..cc6500c4ed 100644 --- a/src/corelib/global/qprocessordetection.h +++ b/src/corelib/global/qprocessordetection.h @@ -95,13 +95,14 @@ 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 @@ -112,11 +113,13 @@ || 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__) -- cgit v1.2.3