From 0b338053bf57bfe29230791472d1d4c6b16e0cb1 Mon Sep 17 00:00:00 2001 From: mquinson Date: Tue, 10 Jul 2007 16:40:20 +0000 Subject: [PATCH] Make sure min and max macro are declared everywhere in simgrid git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3709 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- include/xbt/misc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/xbt/misc.h b/include/xbt/misc.h index 6a5f341ec0..cb1ef332cb 100644 --- a/include/xbt/misc.h +++ b/include/xbt/misc.h @@ -56,6 +56,18 @@ # define XBT_INLINE inline #endif +/* improvable on gcc (by evaluating arguments only once), but wouldn't be portable */ +#ifdef MIN +# undef MIN +#endif +#define MIN(a,b) ((a)<(b)?(a):(b)) + +#ifdef MAX +# undef MAX +#endif +#define MAX(a,b) ((a)>(b)?(a):(b)) + + /* * Function calling convention (not used for now) */ -- 2.20.1