diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-10-06 21:04:25 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-10-06 21:04:25 -0700 |
commit | 475e058d40690803a4114f5aa9055023af6e6b4b (patch) | |
tree | 352b9ccb4fd147dd098135fa70145358dc0b6387 /dive.h | |
parent | 34db6dc2bea6173c070c9820a2e57a511b9ca0b1 (diff) | |
download | subsurface-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.h | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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> |