From: mquinson Date: Tue, 10 Jul 2007 16:40:20 +0000 (+0000) Subject: Make sure min and max macro are declared everywhere in simgrid X-Git-Tag: v3.3~1651 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/0b338053bf57bfe29230791472d1d4c6b16e0cb1 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 --- 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) */