Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make sure min and max macro are declared everywhere in simgrid
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 10 Jul 2007 16:40:20 +0000 (16:40 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 10 Jul 2007 16:40:20 +0000 (16:40 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3709 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/xbt/misc.h

index 6a5f341..cb1ef33 100644 (file)
 #    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) 
  */