Promote the GCC/libc++/<memory> 'typedef float float32_t' workaround to SkTypes.h
authorbsalomon <bsalomon@google.com>
Fri, 8 Jul 2016 10:28:42 +0000 (03:28 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 8 Jul 2016 10:28:42 +0000 (03:28 -0700)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2135453002

Review-Url: https://codereview.chromium.org/2135453002

include/core/SkTypes.h
src/core/SkSharedMutex.h

index 4e95c69..b382682 100644 (file)
@@ -9,6 +9,22 @@
 #define SkTypes_DEFINED
 
 // IWYU pragma: begin_exports
+
+// In at least two known scenarios when using GCC with libc++:
+//  * GCC 4.8 targeting ARMv7 with NEON
+//  * GCC 4.9 targeting ARMv8 64 bit
+// we need to typedef float float32_t (or include <arm_neon.h> which does that)
+// before #including <memory>. This makes no sense.  I'm not very interested in
+// understanding why... these are old, bizarre platform configuration that we
+// should just let die.
+#include <ciso646>  // Include something innocuous to define _LIBCPP_VERISON if it's libc++.
+#if defined(__GNUC__) && __GNUC__ == 4 \
+ && ((defined(SK_CPU_ARM32) && defined(SK_ARM_HAS_NEON)) || defined(SK_CPU_ARM64)) \
+ && defined(_LIBCPP_VERSION)
+    typedef float float32_t;
+    #include <memory>
+#endif
+
 #include "SkPreConfig.h"
 #include "SkUserConfig.h"
 #include "SkPostConfig.h"
index 302940b..21c9f46 100644 (file)
 
 #ifdef SK_DEBUG
     #include "SkMutex.h"
-
-    // On GCC 4.8, targeting ARMv7 with NEON, using libc++, we need to typedef float float32_t,
-    // (or include <arm_neon.h> which does that) before #including <memory> here.
-    // This makes no sense.  I'm not very interested in understanding why... this is an old,
-    // bizarre platform configuration that we should just let die.
-    #include <ciso646>  // Include something innocuous to define _LIBCPP_VERISON if it's libc++.
-    #if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 8 \
-     && defined(SK_CPU_ARM32) && defined(SK_ARM_HAS_NEON) \
-     && defined(_LIBCPP_VERSION)
-        typedef float float32_t;
-    #endif
-
     #include <memory>
 #endif  // SK_DEBUG