Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fixed nasty border condition bug.
[simgrid.git] / include / xbt / misc.h
index 6a5f341..44a3b79 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) 
  */
 #  define XBT_PUBLIC(type)            extern type
 #  define XBT_EXPORT_NO_IMPORT(type)  type
 #  define XBT_IMPORT_NO_EXPORT(type)  type
-#  define XBT_PUBLIC_DATA(type)       type
+#  define XBT_PUBLIC_DATA(type)       extern type
 #endif
    
 #if !defined (max) && !defined(__cplusplus)