-#ifndef XBT_PUBLIC
-# ifdef _WIN32
-# define XBT_PUBLIC __declspec(dllimport)
-# else
-# define XBT_PUBLIC extern
-# endif /* _WIN32 */
-#endif /* !XBT_PUBLIC */
-
-/* Function calling convention (not used for now) */
-#if !defined (_XBT_CALL)
-#define _XBT_CALL
+
+
+#ifdef DLL_EXPORT
+# define XBT_PUBLIC(type) __declspec(dllexport) type
+# define XBT_PUBLIC_NO_IMPORT(type) __declspec(dllexport) type
+# define XBT_IMPORT_NO_PUBLIC(type) type
+#else
+# ifdef DLL_STATIC
+# define XBT_PUBLIC(type) type
+# define XBT_PUBLIC_NO_IMPORT(type) type
+# define XBT_IMPORT_NO_PUBLIC(type) type
+# else
+# ifdef _WIN32
+# define XBT_PUBLIC(type) __declspec(dllimport) type
+# define XBT_PUBLIC_NO_IMPORT(type) type
+# define XBT_IMPORT_NO_PUBLIC(type) __declspec(dllimport) type
+# else
+# define XBT_PUBLIC(type) extern type
+# define XBT_PUBLIC_NO_IMPORT(type) type
+# define XBT_IMPORT_NO_PUBLIC(type) type
+# endif
+# endif