X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fmacro.h;h=4e5d0f4f2f8d304e10403b34a31378785c087e37;hb=9607d9470eec07df817e58f64d312ccb5ac4cfcc;hp=80cb2f0892f9a2d41ae9918cb5644e99e6bca3f6;hpb=a9c55a882f021318fa728af78f398f4fb7ad7c85;p=elogind.git diff --git a/src/shared/macro.h b/src/shared/macro.h index 80cb2f089..4e5d0f4f2 100644 --- a/src/shared/macro.h +++ b/src/shared/macro.h @@ -46,6 +46,9 @@ #define _introspect_(x) __attribute__((section("introspect." x))) #define _alignas_(x) __attribute__((aligned(__alignof(x)))) +/* automake test harness */ +#define EXIT_TEST_SKIP 77 + #define XSTRINGIFY(x) #x #define STRINGIFY(x) XSTRINGIFY(x) @@ -68,29 +71,27 @@ static inline size_t ALIGN_TO(size_t l, size_t ali) { const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) -#ifndef MAX -#define MAX(a,b) \ - __extension__ ({ \ - typeof(a) _a = (a); \ - typeof(b) _b = (b); \ - _a > _b ? _a : _b; \ +#undef MAX +#define MAX(a,b) \ + __extension__ ({ \ + typeof(a) _a = (a); \ + typeof(b) _b = (b); \ + _a > _b ? _a : _b; \ }) -#endif -#define MAX3(a,b,c) \ - MAX(MAX(a,b),c) +#define MAX3(x,y,z) \ + __extension__ ({ \ + typeof(x) _c = MAX(x,y); \ + MAX(_c, z); \ + }) -#ifndef MIN +#undef MIN #define MIN(a,b) \ __extension__ ({ \ typeof(a) _a = (a); \ typeof(b) _b = (b); \ _a < _b ? _a : _b; \ }) -#endif - -#define MIN3(a,b,c) \ - MIN(MIN(a,b),c) #ifndef CLAMP #define CLAMP(x, low, high) \