X-Git-Url: https://git.distorted.org.uk/~mdw/mLib/blobdiff_plain/e6591bec0938b76b8c02083eb6ba101aba4e1b7e..b64eb60f6c1fdb12f3922e04913e137199838807:/utils/macros.h diff --git a/utils/macros.h b/utils/macros.h index 73230bd..954ed0c 100644 --- a/utils/macros.h +++ b/utils/macros.h @@ -110,6 +110,12 @@ # 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) @@ -233,6 +239,14 @@ # define MUST_CHECK #endif +#ifndef LAUNDER +# define LAUNDER +#endif + +#ifndef RELAX +# define RELAX +#endif + #ifndef GCC_WARNING # define GCC_WARNING(warn) #endif