'libs/ardour' - DLL visibility stuff and associated changes needed for building with...
authorJohn Emmas <johne53@tiscali.co.uk>
Tue, 14 Jan 2014 10:13:12 +0000 (10:13 +0000)
committerJohn Emmas <johne53@tiscali.co.uk>
Tue, 14 Jan 2014 16:47:27 +0000 (16:47 +0000)
12 files changed:
libs/ardour/ardour/ardour.h
libs/ardour/ardour/automatable_sequence.h
libs/ardour/ardour/comparable_shared_ptr.h
libs/ardour/ardour/configuration_variable.h
libs/ardour/ardour/directory_names.h
libs/ardour/ardour/export_format_base.h
libs/ardour/ardour/midi_model.h
libs/ardour/ardour/midi_ring_buffer.h
libs/ardour/ardour/monitor_processor.h
libs/ardour/ardour/revision.h
libs/ardour/ardour/session.h
libs/ardour/ardour/visibility.h [new file with mode: 0644]

index 90a6272fac8e28855b982350b338f5e9a0ace8ad..5e747f5665db322e7f7dc8a0ec6f3e3c63b1e99b 100644 (file)
@@ -49,8 +49,8 @@ namespace ARDOUR {
 
        class AudioEngine;
 
-       LIBARDOUR_API extern PBD::Signal1<void,std::string> BootMessage;
-       LIBARDOUR_API extern PBD::Signal0<void> GUIIdle;
+       extern LIBARDOUR_API PBD::Signal1<void,std::string> BootMessage;
+       extern LIBARDOUR_API PBD::Signal0<void> GUIIdle;
 
        /**
         * @param with_vst true to enable VST Support
@@ -66,9 +66,9 @@ namespace ARDOUR {
        LIBARDOUR_API bool no_auto_connect ();
        LIBARDOUR_API void make_property_quarks ();
 
-       LIBARDOUR_API extern PBD::PropertyChange bounds_change;
+       extern LIBARDOUR_API PBD::PropertyChange bounds_change;
 
-       LIBARDOUR_API extern const char* const ardour_config_info;
+       extern /*LIBARDOUR_API*/ const char* const ardour_config_info;
 
        LIBARDOUR_API void find_bindings_files (std::map<std::string,std::string>&);
 
index 82a1d367e8c75e2d1d1047f690afe4334e539014..b0003189a441dadabbe872389213c0694fd377f6 100644 (file)
@@ -27,7 +27,7 @@ namespace ARDOUR {
 
 /** Contains notes and controllers */
 template<typename T>
-class LIBARDOUR_API AutomatableSequence : public Automatable, public Evoral::Sequence<T> {
+class /*LIBARDOUR_API*/ AutomatableSequence : public Automatable, public Evoral::Sequence<T> {
 public:
        AutomatableSequence(Session& s)
                : Evoral::ControlSet()
index 0aaacd665976f14cfb4e3d26daf528e5b3a52a7e..f5e9cd346a5cfbb46cd3c728f7cad105a440b16e 100644 (file)
@@ -26,7 +26,7 @@
 namespace ARDOUR {
 
 template<typename T>
-class LIBARDOUR_API ComparableSharedPtr : public boost::shared_ptr<T>
+class /*LIBARDOUR_API*/ ComparableSharedPtr : public boost::shared_ptr<T>
                           , public boost::less_than_comparable<ComparableSharedPtr<T> >
 {
   public:
index a1262649294a1a314e05ce75daa475539e50d409..7a83c34c3f450fb46ab12212c33da879bab2d5cc 100644 (file)
@@ -52,7 +52,7 @@ class LIBARDOUR_API ConfigVariableBase {
 };
 
 template<class T>
-class LIBARDOUR_API ConfigVariable : public ConfigVariableBase
+class /*LIBARDOUR_API*/ ConfigVariable : public ConfigVariableBase
 {
   public:
 
@@ -92,7 +92,7 @@ class LIBARDOUR_API ConfigVariable : public ConfigVariableBase
 
 /** Specialisation of ConfigVariable for std::string to cope with whitespace properly */
 template<>
-class LIBARDOUR_API ConfigVariable<std::string> : public ConfigVariableBase
+class /*LIBARDOUR_API*/ ConfigVariable<std::string> : public ConfigVariableBase
 {
   public:
 
@@ -127,7 +127,7 @@ class LIBARDOUR_API ConfigVariable<std::string> : public ConfigVariableBase
 };
 
 template<>
-class LIBARDOUR_API ConfigVariable<bool> : public ConfigVariableBase
+class /*LIBARDOUR_API*/ ConfigVariable<bool> : public ConfigVariableBase
 {
   public:
 
@@ -164,7 +164,7 @@ class LIBARDOUR_API ConfigVariable<bool> : public ConfigVariableBase
 };
 
 template<class T>
-class LIBARDOUR_API ConfigVariableWithMutation : public ConfigVariable<T>
+class /*LIBARDOUR_API*/ ConfigVariableWithMutation : public ConfigVariable<T>
 {
   public:
        ConfigVariableWithMutation (std::string name, T val, T (*m)(T))
@@ -193,7 +193,7 @@ class LIBARDOUR_API ConfigVariableWithMutation : public ConfigVariable<T>
 };
 
 template<>
-class LIBARDOUR_API ConfigVariableWithMutation<std::string> : public ConfigVariable<std::string>
+class /*LIBARDOUR_API*/ ConfigVariableWithMutation<std::string> : public ConfigVariable<std::string>
 {
   public:
        ConfigVariableWithMutation (std::string name, std::string val, std::string (*m)(std::string))
index db5d770739765e80632523522841671dff6ca2b9..17532e2a3aff8c5cd928e25dbc2a52521f62feda 100644 (file)
@@ -39,6 +39,7 @@ namespace ARDOUR {
        LIBARDOUR_API extern const char* const templates_dir_name;
        LIBARDOUR_API extern const char* const route_templates_dir_name;
        LIBARDOUR_API extern const char* const surfaces_dir_name;
+       LIBARDOUR_API extern const char* const ladspa_dir_name;
        LIBARDOUR_API extern const char* const user_config_dir_name;
        LIBARDOUR_API extern const char* const panner_dir_name;
        LIBARDOUR_API extern const char* const backend_dir_name;
index 7ffb433e1af3a65c8a031e42cb7574974a836b39..7f09d148fe7adf10940f60a9841199d210e301ab 100644 (file)
@@ -114,7 +114,7 @@ class LIBARDOUR_API ExportFormatBase {
        };
 
        /// Class for managing selection and compatibility states
-       class SelectableCompatible {
+       class LIBARDOUR_API SelectableCompatible {
          public:
                SelectableCompatible ()
                        : _selected (false), _compatible (true) { }
index e76a993b4165b827b808d0940d328a5500bbe799..dc1c7af0e9796daf97c14a29e06f567543bbbea7 100644 (file)
@@ -58,7 +58,7 @@ public:
        NoteMode note_mode() const { return (percussive() ? Percussive : Sustained); }
        void set_note_mode(NoteMode mode) { set_percussive(mode == Percussive); };
 
-       class DiffCommand : public Command {
+       class LIBARDOUR_API DiffCommand : public Command {
        public:
 
                DiffCommand (boost::shared_ptr<MidiModel> m, const std::string& name);
@@ -79,7 +79,7 @@ public:
 
        };
 
-       class NoteDiffCommand : public DiffCommand {
+       class LIBARDOUR_API NoteDiffCommand : public DiffCommand {
        public:
 
                NoteDiffCommand (boost::shared_ptr<MidiModel> m, const std::string& name) : DiffCommand (m, name) {}
@@ -145,7 +145,7 @@ public:
        };
 
        /* Currently this class only supports changes of sys-ex time, but could be expanded */
-       class SysExDiffCommand : public DiffCommand {
+       class LIBARDOUR_API SysExDiffCommand : public DiffCommand {
        public:
                SysExDiffCommand (boost::shared_ptr<MidiModel> m, const XMLNode& node);
 
@@ -180,7 +180,7 @@ public:
                Change unmarshal_change (XMLNode *);
        };
 
-       class PatchChangeDiffCommand : public DiffCommand {
+       class LIBARDOUR_API PatchChangeDiffCommand : public DiffCommand {
        public:
                PatchChangeDiffCommand (boost::shared_ptr<MidiModel>, const std::string &);
                PatchChangeDiffCommand (boost::shared_ptr<MidiModel>, const XMLNode &);
index 2d35be679f6b5d97ed3b9a23f60add6126366de8..78d14b91851d810ffa365e192ca80ed84e073d2c 100644 (file)
@@ -41,7 +41,7 @@ class MidiBuffer;
  * [timestamp][type][size][size bytes of raw MIDI][timestamp][type][size](etc...)
  */
 template<typename T>
-class LIBARDOUR_API MidiRingBuffer : public Evoral::EventRingBuffer<T> {
+class /*LIBARDOUR_API*/ MidiRingBuffer : public Evoral::EventRingBuffer<T> {
 public:
        /** @param size Size in bytes.
         */
index 41e911f57c2a399c3f172406565f4c05e277378b..33b3e9c366ded42a3b8da233cef04f8d1ba3fff3 100644 (file)
@@ -39,7 +39,7 @@ namespace ARDOUR {
 class Session;
 
 template<typename T>
-class LIBARDOUR_API MPControl : public PBD::Controllable {
+class /*LIBARDOUR_API*/ MPControl : public PBD::Controllable {
 public:
        MPControl (T initial, const std::string& name, PBD::Controllable::Flag flag,
                   float lower = 0.0f, float upper = 1.0f)
index 849a96fa07737ef8d318918e47929cf5abc37f16..7374c0839bd114dd85ea73518ec3d6f00a4236db 100644 (file)
 #include "ardour/libardour_visibility.h"
 
 namespace ARDOUR {
-       LIBARDOUR_API extern const char* revision;
+
+       /*LIBARDOUR_API extern*/ extern const char* revision;
+       
+       extern "C" {
+               LIBARDOUR_API const char* get_ardour_revision();
+       }
 }
 
 #endif
index 08f4c1315a250e9b78b394d68dbd8be2f804c229..7295828d2f9b63124e127829f133418d50fab0e4 100644 (file)
@@ -238,7 +238,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
                return _bundles.reader ();
        }
 
-       struct RoutePublicOrderSorter {
+       struct LIBARDOUR_API RoutePublicOrderSorter {
                bool operator() (boost::shared_ptr<Route>, boost::shared_ptr<Route> b);
        };
 
diff --git a/libs/ardour/ardour/visibility.h b/libs/ardour/ardour/visibility.h
new file mode 100644 (file)
index 0000000..7f79dd6
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+    Copyright (C) 2013 Paul Davis
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef __libardour_visibility_h__
+#define __libardour_visibility_h__
+
+#include "ardour/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_APICALLTYPE __cdecl
+       #elif defined(COMPILER_MSVC) || defined(COMPILER_MINGW) // Probably needs Cygwin too, at some point
+               #define LIBARDOUR_APICALLTYPE __cdecl
+       #else
+               #error "Attempting to define __declspec with an incompatible compiler !"
+       #endif
+#elif !defined(LIBARDOUR_APICALLTYPE)
+       // Other compilers / platforms could be accommodated here (as an example, see LIBARDOUR_HELPER_DLL, below)
+       #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.
+ */
+
+#if defined _WIN32 || defined __CYGWIN__ || defined(COMPILER_MSVC) || defined(COMPILER_MINGW)
+  #define LIBARDOUR_HELPER_DLL_IMPORT __declspec(dllimport)
+  #define LIBARDOUR_HELPER_DLL_EXPORT __declspec(dllexport)
+  #define LIBARDOUR_HELPER_DLL_LOCAL
+#else
+  #if __GNUC__ >= 4
+    #define LIBARDOUR_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
+    #define LIBARDOUR_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
+    #define LIBARDOUR_HELPER_DLL_LOCAL  __attribute__ ((visibility ("hidden")))
+  #else
+    #define LIBARDOUR_HELPER_DLL_IMPORT
+    #define LIBARDOUR_HELPER_DLL_EXPORT
+    #define LIBARDOUR_HELPER_DLL_LOCAL
+  #endif
+#endif
+
+#endif /* __libardour_visibility_h__ */