Merge branch 'ldionne-ldionne-cmake' into dev
[libcds.git] / cds / compiler / gcc / compiler_macro.h
index 6eb056569111bf6217b3a1b80cdab914718258e5..18178c8689e16a80fbe1325cff414d1c5832f8ec 100644 (file)
 #   endif
 #endif
 
-#if CDS_PROCESSOR_ARCH == CDS_PROCESSOR_X86
-#   define CDS_STDCALL __attribute__((stdcall))
+// Byte order
+#if !defined(CDS_ARCH_LITTLE_ENDIAN) && !defined(CDS_ARCH_BIG_ENDIAN)
+#   ifdef __BYTE_ORDER__
+#       if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#           define CDS_ARCH_LITTLE_ENDIAN
+#       elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+#           define CDS_ARCH_BIG_ENDIAN
+#       endif
+#   else
+#       warning "Undefined byte order for current architecture (no __BYTE_ORDER__ preprocessor definition)"
+#   endif
+#endif
+
+// Sanitizer attributes
+// Example: CDS_DISABLE_SANITIZE( "function" )
+#ifdef CDS_ADDRESS_SANITIZER_ENABLED
+#   define CDS_SUPPRESS_SANITIZE( ... ) __attribute__(( no_sanitize( __VA_ARGS__ )))
 #else
-#   define CDS_STDCALL
+#   define CDS_SUPPRESS_SANITIZE( ... )
 #endif