'libs/ardour' - Add 'LIBARDOUR_API' (initial testing). Ensures that libardour classes...
authorJohn Emmas <johne53@tiscali.co.uk>
Tue, 15 Oct 2013 16:32:57 +0000 (17:32 +0100)
committerJohn Emmas <johne53@tiscali.co.uk>
Tue, 15 Oct 2013 16:32:57 +0000 (17:32 +0100)
libs/ardour/ardour/msvc_libardour.h
libs/ardour/ardour/session_event.h
libs/ardour/ardour/visibility.h

index 75c932905eaec998e6d4cca31109dcc7b509f144..52aa65d95c7bb39e0cf3cc86534c1da9c3f32d70 100644 (file)
 #ifndef __msvc_libardour_h__
 #define __msvc_libardour_h__
 
+#include "ardour/visibility.h"
 #include <limits.h>
 
-#ifdef  LIBARDOUR_IS_IN_WIN_STATIC_LIB  // #define if your project uses libardour (under Windows) as a static library
-#define LIBARDOUR_IS_IN_WINDLL 0
-#endif
-
-#if !defined(LIBARDOUR_IS_IN_WINDLL)
-       #if defined(COMPILER_MSVC) || defined(COMPILER_MINGW)
-       // If you need '__declspec' compatibility, add extra compilers to the above as necessary
-               #define LIBARDOUR_IS_IN_WINDLL 1
-       #else
-               #define LIBARDOUR_IS_IN_WINDLL 0
-       #endif
-#endif
-
-#if LIBARDOUR_IS_IN_WINDLL && !defined(LIBARDOUR_API)
-       #if defined(BUILDING_LIBARDOUR)
-               #define LIBARDOUR_API __declspec(dllexport)
-               #define LIBARDOUR_APICALLTYPE __stdcall
-       #elif defined(COMPILER_MSVC) || defined(COMPILER_MINGW) // Probably needs Cygwin too, at some point
-               #define LIBARDOUR_API __declspec(dllimport)
-               #define LIBARDOUR_APICALLTYPE __stdcall
-       #else
-               #error "Attempting to define __declspec with an incompatible compiler !"
-       #endif
-#elif !defined(LIBARDOUR_API)
-       // Other compilers / platforms could be accommodated here
-       #define LIBARDOUR_API
-       #define LIBARDOUR_APICALLTYPE
-#endif
-
 #ifndef _MAX_PATH
 #define _MAX_PATH  260
 #endif
index ccec43d909fc9790ca6895d43c3c194a95686b33..e90ab71e26711b3fafbbbc50c3a6c7b1a81d1d03 100644 (file)
@@ -28,6 +28,7 @@
 #include "pbd/ringbuffer.h"
 #include "pbd/event_loop.h"
 
+#include "ardour/visibility.h"
 #include "ardour/types.h"
 
 namespace ARDOUR {
@@ -35,7 +36,7 @@ namespace ARDOUR {
 class Slave;
 class Region;
 
-class SessionEvent {
+class LIBARDOUR_API SessionEvent {
 public:
        enum Type {
                SetTransportSpeed,
@@ -150,7 +151,7 @@ private:
        friend class Butler;
 };
 
-class SessionEventManager {
+class LIBARDOUR_API SessionEventManager {
 public:
        SessionEventManager () : pending_events (2048),
                                 auto_loop_event(0), punch_out_event(0), punch_in_event(0) {}
index 09287b877d317fea3a8d8652b2693a1d7e18e8d5..b702e94edb028f6734a8508df0c6ffedf4cd0045 100644 (file)
 #ifndef __libardour_visibility_h__
 #define __libardour_visibility_h__
 
+#ifdef  LIBARDOUR_IS_IN_WIN_STATIC_LIB  // #define if your project uses libardour (under Windows) as a static library
+#define LIBARDOUR_IS_IN_WINDLL 0
+#endif
+
+#if !defined(LIBARDOUR_IS_IN_WINDLL)
+       #if defined(COMPILER_MSVC) || defined(COMPILER_MINGW)
+       // If you need '__declspec' compatibility, add extra compilers to the above as necessary
+               #define LIBARDOUR_IS_IN_WINDLL 1
+       #else
+               #define LIBARDOUR_IS_IN_WINDLL 0
+       #endif
+#endif
+
+#if LIBARDOUR_IS_IN_WINDLL && !defined(LIBARDOUR_API)
+       #if defined(BUILDING_LIBARDOUR)
+               #define LIBARDOUR_API __declspec(dllexport)
+               #define LIBARDOUR_APICALLTYPE __cdecl
+       #elif defined(COMPILER_MSVC) || defined(COMPILER_MINGW) // Probably needs Cygwin too, at some point
+               #define LIBARDOUR_API __declspec(dllimport)
+               #define LIBARDOUR_APICALLTYPE __cdecl
+       #else
+               #error "Attempting to define __declspec with an incompatible compiler !"
+       #endif
+#elif !defined(LIBARDOUR_API)
+       // Other compilers / platforms could be accommodated here (as an example, see LIBARDOUR_HELPER_DLL, below)
+       #define LIBARDOUR_API
+       #define LIBARDOUR_APICALLTYPE
+#endif
+
+
 /* _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.