Fixed warnings from arm builds with -Wundef
authorRohan McGovern <rohan.mcgovern@nokia.com>
Tue, 6 Mar 2012 07:50:05 +0000 (17:50 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 6 Mar 2012 23:03:18 +0000 (00:03 +0100)
Do not use the value of a macro before verifying that the macro
is defined.

Change-Id: I36bebe37da5f4e5e7af1e423b7f2b18091e35707
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
src/corelib/global/qprocessordetection.h

index 4213d58..1f16f09 100644 (file)
@@ -93,7 +93,7 @@
       || defined(__ARM_ARCH_7A__) \
       || defined(__ARM_ARCH_7R__) \
       || defined(__ARM_ARCH_7M__) \
-      || (__TARGET_ARCH_ARM-0 >= 7)
+      || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_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__) \
-      || (__TARGET_ARCH_ARM-0 >= 6)
+      || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6)
 #    define Q_PROCESSOR_ARM_V6
 #    define Q_PROCESSOR_ARM_V5
 #  elif defined(__ARM_ARCH_5TEJ__) \
-        || (__TARGET_ARCH_ARM-0 >= 5)
+        || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5)
 #    define Q_PROCESSOR_ARM_V5
 #  endif
 #  if defined(__ARMEL__)