X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6613d5a1da400fda1d9c4fc36c0e232ae7aabaef..c8563afcccc9caa2b2db1c99308e3c531bf9c506:/include/xbt/misc.h diff --git a/include/xbt/misc.h b/include/xbt/misc.h index 51e23cfb65..2a8e02ea41 100644 --- a/include/xbt/misc.h +++ b/include/xbt/misc.h @@ -111,38 +111,43 @@ /* Build the DLL */ -#if defined(DLL_EXPORT) +#if defined(DLL_EXPORT) # 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_PUBLIC_DATA __declspec(dllexport) /* Pack everything up statically */ -#elif defined(DLL_STATIC) +#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_IMPORT_NO_EXPORT(type) type +# define XBT_PUBLIC_DATA + /* Link against the DLL */ -#elif defined(_WIN32) -# define XBT_PUBLIC(type) __declspec(dllimport) type -# define XBT_EXPORT_NO_IMPORT(type) type -# define XBT_IMPORT_NO_EXPORT(type) __declspec(dllimport) type +#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_PUBLIC_DATA __declspec(dllimport) /* Non-UNIX build. Let's keep sain here ;) */ -#else +#else # define XBT_PUBLIC(type) extern type # define XBT_EXPORT_NO_IMPORT(type) type # define XBT_IMPORT_NO_EXPORT(type) type +# define XBT_PUBLIC_DATA #endif #ifndef max -# define max(a, b) (((a) > (b))?(a):(b)) +# define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min -# define min(a, b) (((a) < (b))?(a):(b)) +# define min(a,b) (((a) < (b)) ? (a) : (b)) #endif #define TRUE 1