@@@ all the mess ever
[mLib] / utils / macros.h
index 70f535f..954ed0c 100644 (file)
@@ -57,6 +57,8 @@
        IGNORABLE extern char static_assert_failed[2*!!(cond) - 1]
 #endif
 
+#define COMMA ,
+
 /*----- String and character hacks ----------------------------------------*/
 
 #define CTYPE_HACK(func, ch) (func((unsigned char)(ch)))
 #  define EXECL_LIKE(ntrail) __attribute__((__sentinel__(ntrail)))
 #endif
 
+#if GCC_VERSION_P(2, 7)
+#  define LAUNDER(x)                                                   \
+       ({ __typeof__(x) _y; __asm__("" : "=g"(_y) : "0"(x)); _y; })
+#  define RELAX do __asm__ __volatile__("" ::: "memory"); while (0)
+#endif
+
 #if CLANG_VERSION_P(3, 3)
 
 #  define MLIB__PRAGMA_HACK(x) _Pragma(#x)
 #  define MUST_CHECK
 #endif
 
+#ifndef LAUNDER
+#  define LAUNDER
+#endif
+
+#ifndef RELAX
+#  define RELAX
+#endif
+
 #ifndef GCC_WARNING
 #  define GCC_WARNING(warn)
 #endif