Fixed gcc-4.8 x86 build (the compiler does not support DCAS)
authorkhizmax <libcds.dev@gmail.com>
Thu, 22 Sep 2016 17:08:40 +0000 (20:08 +0300)
committerkhizmax <libcds.dev@gmail.com>
Thu, 22 Sep 2016 17:08:40 +0000 (20:08 +0300)
cds/compiler/gcc/defs.h

index 99d8589c17d33f9c54e24f43196527ccf5e54efa..59c5e86a1c40ba024cafdc6bf3ec5638a4a01b14 100644 (file)
 #define cds_unlikely( expr ) __builtin_expect( !!( expr ), 0 )
 
 // double-width CAS support
-#if CDS_BUILD_BITS == 64
-    // gcc-4.8 does not support 16-word (128bit) atomics
-#   if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 ) && CDS_COMPILER_VERSION >= 40900
-#       define CDS_DCAS_SUPPORT
-#   endif
-#else
-#   ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
-#       define CDS_DCAS_SUPPORT
+// note: gcc-4.8 does not support double-word atomics
+#if CDS_COMPILER_VERSION >= 40900
+#   if CDS_BUILD_BITS == 64
+#       ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
+#           define CDS_DCAS_SUPPORT
+#       endif
+#   else
+#       ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
+#           define CDS_DCAS_SUPPORT
+#       endif
 #   endif
 #endif