chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Always use our own MAX/MIN definitions
[elogind.git]
/
src
/
shared
/
macro.h
diff --git
a/src/shared/macro.h
b/src/shared/macro.h
index 80cb2f0892f9a2d41ae9918cb5644e99e6bca3f6..4e5d0f4f2f8d304e10403b34a31378785c087e37 100644
(file)
--- 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))))
#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)
#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) );})
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
-#
if
ndef MAX
-#define MAX(a,b) \
- __extension__ ({ \
- typeof(a) _a = (a); \
- typeof(b) _b = (b); \
- _a > _b ? _a : _b; \
+#
u
ndef 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); \
+ })
-#
if
ndef MIN
+#
u
ndef MIN
#define MIN(a,b) \
__extension__ ({ \
typeof(a) _a = (a); \
typeof(b) _b = (b); \
_a < _b ? _a : _b; \
})
#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) \
#ifndef CLAMP
#define CLAMP(x, low, high) \