summaryrefslogtreecommitdiffstats
path: root/include/c.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/c.h')
-rw-r--r--include/c.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/c.h b/include/c.h
index 0f6e5b29b..142583956 100644
--- a/include/c.h
+++ b/include/c.h
@@ -107,6 +107,14 @@
_max1 > _max2 ? _max1 : _max2; })
#endif
+#ifndef cmp_numbers
+# define cmp_numbers(x, y) __extension__ ({ \
+ __typeof__(x) _a = (x); \
+ __typeof__(y) _b = (y); \
+ (void) (&_a == &_b); \
+ a == b ? 0 : a > b ? 1 : -1; })
+#endif
+
#ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif