globally remove all trailing whitespace from ardour code base.
[ardour.git] / libs / pbd / pbd / libpbd_visibility.h
index e2c6235f0ba336dded07fbd3dbfe867ca750526d..51fed250841cb480cb0f8857dd570b31e18212df 100644 (file)
 #ifndef __libpbd_libpbd_visibility_h__
 #define __libpbd_libpbd_visibility_h__
 
-/* _WIN32 is defined by most compilers targetting Windows, but within the
- * ardour source tree, we also define COMPILER_MSVC or COMPILER_MINGW depending
- * on how a Windows build is built.
- */
-
-#if defined _WIN32 || defined __CYGWIN__ || defined(COMPILER_MSVC) || defined(COMPILER_MINGW)
+#if defined(COMPILER_MSVC)
   #define LIBPBD_DLL_IMPORT __declspec(dllimport)
   #define LIBPBD_DLL_EXPORT __declspec(dllexport)
   #define LIBPBD_DLL_LOCAL
+  #define LIBPBD_TEMPLATE_DLL_IMPORT
+  #define LIBPBD_TEMPLATE_DLL_EXPORT
+  #define LIBPBD_TEMPLATE_MEMBER_DLL_IMPORT __declspec(dllimport)
+  #define LIBPBD_TEMPLATE_MEMBER_DLL_EXPORT __declspec(dllexport)
 #else
-  #if __GNUC__ >= 4
-    #define LIBPBD_DLL_IMPORT __attribute__ ((visibility ("default")))
-    #define LIBPBD_DLL_EXPORT __attribute__ ((visibility ("default")))
-    #define LIBPBD_DLL_LOCAL  __attribute__ ((visibility ("hidden")))
-  #else
-    #define LIBPBD_DLL_IMPORT
-    #define LIBPBD_DLL_EXPORT
-    #define LIBPBD_DLL_LOCAL
-  #endif
+  #define LIBPBD_DLL_IMPORT __attribute__ ((visibility ("default")))
+  #define LIBPBD_DLL_EXPORT __attribute__ ((visibility ("default")))
+  #define LIBPBD_DLL_LOCAL  __attribute__ ((visibility ("hidden")))
+  #define LIBPBD_TEMPLATE_DLL_IMPORT __attribute__ ((visibility ("default")))
+  #define LIBPBD_TEMPLATE_DLL_EXPORT __attribute__ ((visibility ("default")))
+  #define LIBPBD_TEMPLATE_MEMBER_DLL_IMPORT
+  #define LIBPBD_TEMPLATE_MEMBER_DLL_EXPORT
 #endif
 
-#ifdef LIBPBD_DLL // libpbd is a DLL
-#ifdef LIBPBD_DLL_EXPORTS // defined if we are building the libpbd DLL (instead of using it)
-    #define LIBPBD_API LIBPBD_DLL_EXPORT
+#ifdef LIBPBD_STATIC // libpbd is a DLL
+  #define LIBPBD_API
+  #define LIBPBD_LOCAL
+  #define LIBPBD_TEMPLATE_API
+  #define LIBPBD_TEMPLATE_MEMBER_API
 #else
+  #ifdef LIBPBD_DLL_EXPORTS // defined if we are building the libpbd DLL (instead of using it)
+    #define LIBPBD_API LIBPBD_DLL_EXPORT
+    #define LIBPBD_TEMPLATE_API LIBPBD_TEMPLATE_DLL_EXPORT
+    #define LIBPBD_TEMPLATE_MEMBER_API LIBPBD_TEMPLATE_MEMBER_DLL_EXPORT
+  #else
     #define LIBPBD_API LIBPBD_DLL_IMPORT
-#endif 
-#define     LIBPBD_LOCAL LIBPBD_DLL_LOCAL
-#else /* static lib, not DLL */
-#define LIBPBD_API
-#define LIBPBD_LOCAL
+    #define LIBPBD_TEMPLATE_API LIBPBD_TEMPLATE_DLL_IMPORT
+    #define LIBPBD_TEMPLATE_MEMBER_API LIBPBD_TEMPLATE_MEMBER_DLL_IMPORT
+  #endif
+  #define LIBPBD_LOCAL LIBPBD_DLL_LOCAL
 #endif
 
 #endif /* __libpbd_libpbd_visibility_h__ */