summaryrefslogtreecommitdiff
path: root/api/lib
diff options
context:
space:
mode:
Diffstat (limited to 'api/lib')
-rw-r--r--api/lib/numeric.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/api/lib/numeric.h b/api/lib/numeric.h
index db6c777..2b724e0 100644
--- a/api/lib/numeric.h
+++ b/api/lib/numeric.h
@@ -1,16 +1,17 @@
#pragma once
+#pragma GCC diagnostic ignored "-Wgnu-statement-expression"
#define min(x, y) \
({ \
- typeof (x) _x = (x); \
- typeof (y) _y = (y); \
- _x > _y ? _x : _y; \
+ __typeof__ (x) _x = (x); \
+ __typeof__ (y) _y = (y); \
+ _x < _y ? _x : _y; \
})
#define max(x, y) \
({ \
- typeof (x) _x = (x); \
- typeof (y) _y = (y); \
- _x < _y ? _x : _y; \
+ __typeof__ (x) _x = (x); \
+ __typeof__ (y) _y = (y); \
+ _x > _y ? _x : _y; \
})