chiark
/
gitweb
/
~mdw
/
mLib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
@@@ timeout wip
[mLib]
/
utils
/
macros.h
diff --git
a/utils/macros.h
b/utils/macros.h
index 73230bd23cb524a9459fb4df0f329250886dfa0b..95d0ddba93d9105dc7d43af99b0bffa5ef430534 100644
(file)
--- a/
utils/macros.h
+++ b/
utils/macros.h
@@
-110,6
+110,12
@@
# define EXECL_LIKE(ntrail) __attribute__((__sentinel__(ntrail)))
#endif
# define EXECL_LIKE(ntrail) __attribute__((__sentinel__(ntrail)))
#endif
+#if GCC_VERSION_P(2, 7) || CLANG_VERSION_P(0, 0)
+# 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)
#if CLANG_VERSION_P(3, 3)
# define MLIB__PRAGMA_HACK(x) _Pragma(#x)
@@
-127,7
+133,9
@@
# define MUFFLE_WARNINGS_STMT(warns, body) \
do { MLIB__MUFFLE_WARNINGS(warns, body) } while (0)
# define MUFFLE_WARNINGS_STMT(warns, body) \
do { MLIB__MUFFLE_WARNINGS(warns, body) } while (0)
-#elif GCC_VERSION_P(4, 6)
+#endif
+
+#if GCC_VERSION_P(4, 6)
/* --- Diagnostic suppression in GCC: a tale of woe --- *
*
/* --- Diagnostic suppression in GCC: a tale of woe --- *
*
@@
-233,6
+241,14
@@
# define MUST_CHECK
#endif
# define MUST_CHECK
#endif
+#ifndef LAUNDER
+# define LAUNDER
+#endif
+
+#ifndef RELAX
+# define RELAX
+#endif
+
#ifndef GCC_WARNING
# define GCC_WARNING(warn)
#endif
#ifndef GCC_WARNING
# define GCC_WARNING(warn)
#endif