summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-06 21:04:25 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-06 21:04:25 -0700
commit475e058d40690803a4114f5aa9055023af6e6b4b (patch)
tree352b9ccb4fd147dd098135fa70145358dc0b6387 /dive.h
parent34db6dc2bea6173c070c9820a2e57a511b9ca0b1 (diff)
downloadsubsurface-475e058d40690803a4114f5aa9055023af6e6b4b.tar.gz
Make Windows cross compile again
But this is broken as the utf8/utf16 conversions in windows.c are gone without glib. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>