diff options
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> |