Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Let's not declare the max/min macros in C++ to avoid breaking the already existing...
[simgrid.git] / include / xbt / misc.h
index cbfd518..24ea9c6 100644 (file)
 #  define XBT_PUBLIC(type)            __declspec(dllexport) type
 #  define XBT_EXPORT_NO_IMPORT(type)  __declspec(dllexport) type
 #  define XBT_IMPORT_NO_EXPORT(type)  type 
-#  define XBT_DECLARE_DATA                       __declspec(dllexport)                         
+#  define XBT_PUBLIC_DATA                       __declspec(dllexport)
 
 /* Pack everything up statically */
 #elif defined(DLL_STATIC)
 #  define XBT_PUBLIC(type)            type
 #  define XBT_EXPORT_NO_IMPORT(type)  type
 #  define XBT_IMPORT_NO_EXPORT(type)  type
-#  define XBT_DECLARE_DATA 
+#  define XBT_PUBLIC_DATA                
+     
 
 /* Link against the DLL */
 #elif (defined(_WIN32) && !defined(DLL_EXPORT))
-#  define XBT_PUBLIC(type)            __declspec(dllimport) type
-#  define XBT_EXPORT_NO_IMPORT(type)  type
-#  define XBT_IMPORT_NO_EXPORT(type)  __declspec(dllimport) type
-#  define XBT_DECLARE_DATA                       __declspec(dllimport) 
+#  define XBT_PUBLIC(type)             __declspec(dllimport) type
+#  define XBT_EXPORT_NO_IMPORT(type)   type
+#  define XBT_IMPORT_NO_EXPORT(type)   __declspec(dllimport) type
+#  define XBT_PUBLIC_DATA                              __declspec(dllimport)           
 
 /* Non-UNIX build. Let's keep sain here ;) */
 #else
 #  define XBT_PUBLIC(type)            extern type
 #  define XBT_EXPORT_NO_IMPORT(type)  type
 #  define XBT_IMPORT_NO_EXPORT(type)  type
-#  define XBT_DECLARE_DATA
+#  define XBT_PUBLIC_DATA       
 #endif
    
-
-
-
-#ifndef max
+#if !defined (max) && !defined(__cplusplus)
 #  define max(a,b)     (((a) > (b)) ? (a) : (b))
 #endif
-#ifndef min
+#if !defined (min) && !defined(__cplusplus)
 #  define min(a,b)     (((a) < (b)) ? (a) : (b))
 #endif
 
 # endif
 #endif
 
-/*! C++ users need love */
 #ifndef SG_END_DECL
 # ifdef __cplusplus
 #  define SG_END_DECL() }