summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/dive.h b/dive.h
index a6347b897..78d91f066 100644
--- a/dive.h
+++ b/dive.h
@@ -5,7 +5,19 @@
#include <stdint.h>
#include <time.h>
#include <math.h>
-#include <sys/param.h>
+
+/* Windows has no MIN/MAX macros - so let's just roll our own */
+#define MIN(x, y) ({ \
+ typeof(x) _min1 = (x); \
+ typeof(y) _min2 = (y); \
+ (void) (&_min1 == &_min2); \
+ _min1 < _min2 ? _min1 : _min2; })
+
+#define MAX(x, y) ({ \
+ typeof(x) _max1 = (x); \
+ typeof(y) _max2 = (y); \
+ (void) (&_max1 == &_max2); \
+ _max1 > _max2 ? _max1 : _max2; })
#include <libxml/tree.h>
#include <libxslt/transform.h>