x86intrinsic seems to be problematic for clang
authorDave Watson <davejwatson@fb.com>
Thu, 29 Aug 2013 22:40:57 +0000 (15:40 -0700)
committerJordan DeLong <jdelong@fb.com>
Sun, 8 Sep 2013 01:50:51 +0000 (18:50 -0700)
Summary: fbinject (clang code parser) throws some errors when
including the x86intrinsic header.

Test Plan:
D929356 compiles after this diff.  It adds a dep on RWSpinLock.

Reviewed By: beng@fb.com

FB internal diff: D950285

folly/RWSpinLock.h

index ab467c5cbc61d0113fafef55f03325dcfab6bf8e..8077720775c7f9528579402230eafc1db20c8962 100644 (file)
@@ -106,8 +106,9 @@ pthread_rwlock_t Read        728698     24us       101ns     7.28ms     194us
 
 */
 
-#if defined(__GNUC__) && (defined(__i386) || defined(__x86_64__) || \
-    defined(ARCH_K8))
+#if defined(__GNUC__) && !defined(__clang__) && \
+  (defined(__i386) || defined(__x86_64__) || \
+   defined(ARCH_K8))
 #define RW_SPINLOCK_USE_X86_INTRINSIC_
 #include <x86intrin.h>
 #else