From eb023b74965aa8d3989bda09aa84017c478ae9a2 Mon Sep 17 00:00:00 2001 From: John Emmas Date: Tue, 14 Jan 2014 10:13:12 +0000 Subject: [PATCH 1/3] 'libs/ardour' - DLL visibility stuff and associated changes needed for building with MSVC. Currently includes debugging information and things that are just commented out until we have known compatibility with the other platforms (i.e. contains stuff to be removed at a later date) --- libs/ardour/ardour/ardour.h | 8 ++++---- libs/ardour/ardour/automatable_sequence.h | 2 +- libs/ardour/ardour/comparable_shared_ptr.h | 2 +- libs/ardour/ardour/configuration_variable.h | 10 +++++----- libs/ardour/ardour/debug.h | 1 + libs/ardour/ardour/directory_names.h | 1 + libs/ardour/ardour/export_format_base.h | 2 +- libs/ardour/ardour/filesystem_paths.h | 4 ++-- libs/ardour/ardour/midi_model.h | 8 ++++---- libs/ardour/ardour/midi_ring_buffer.h | 2 +- libs/ardour/ardour/monitor_processor.h | 2 +- libs/ardour/ardour/revision.h | 7 ++++++- libs/ardour/ardour/session.h | 4 ++-- libs/ardour/ardour/visibility.h | 7 +++---- 14 files changed, 33 insertions(+), 27 deletions(-) diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h index 90a6272fac..5e747f5665 100644 --- a/libs/ardour/ardour/ardour.h +++ b/libs/ardour/ardour/ardour.h @@ -49,8 +49,8 @@ namespace ARDOUR { class AudioEngine; - LIBARDOUR_API extern PBD::Signal1 BootMessage; - LIBARDOUR_API extern PBD::Signal0 GUIIdle; + extern LIBARDOUR_API PBD::Signal1 BootMessage; + extern LIBARDOUR_API PBD::Signal0 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&); diff --git a/libs/ardour/ardour/automatable_sequence.h b/libs/ardour/ardour/automatable_sequence.h index 82a1d367e8..b0003189a4 100644 --- a/libs/ardour/ardour/automatable_sequence.h +++ b/libs/ardour/ardour/automatable_sequence.h @@ -27,7 +27,7 @@ namespace ARDOUR { /** Contains notes and controllers */ template -class LIBARDOUR_API AutomatableSequence : public Automatable, public Evoral::Sequence { +class /*LIBARDOUR_API*/ AutomatableSequence : public Automatable, public Evoral::Sequence { public: AutomatableSequence(Session& s) : Evoral::ControlSet() diff --git a/libs/ardour/ardour/comparable_shared_ptr.h b/libs/ardour/ardour/comparable_shared_ptr.h index 0aaacd6659..f5e9cd346a 100644 --- a/libs/ardour/ardour/comparable_shared_ptr.h +++ b/libs/ardour/ardour/comparable_shared_ptr.h @@ -26,7 +26,7 @@ namespace ARDOUR { template -class LIBARDOUR_API ComparableSharedPtr : public boost::shared_ptr +class /*LIBARDOUR_API*/ ComparableSharedPtr : public boost::shared_ptr , public boost::less_than_comparable > { public: diff --git a/libs/ardour/ardour/configuration_variable.h b/libs/ardour/ardour/configuration_variable.h index a126264929..7a83c34c3f 100644 --- a/libs/ardour/ardour/configuration_variable.h +++ b/libs/ardour/ardour/configuration_variable.h @@ -52,7 +52,7 @@ class LIBARDOUR_API ConfigVariableBase { }; template -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 : public ConfigVariableBase +class /*LIBARDOUR_API*/ ConfigVariable : public ConfigVariableBase { public: @@ -127,7 +127,7 @@ class LIBARDOUR_API ConfigVariable : public ConfigVariableBase }; template<> -class LIBARDOUR_API ConfigVariable : public ConfigVariableBase +class /*LIBARDOUR_API*/ ConfigVariable : public ConfigVariableBase { public: @@ -164,7 +164,7 @@ class LIBARDOUR_API ConfigVariable : public ConfigVariableBase }; template -class LIBARDOUR_API ConfigVariableWithMutation : public ConfigVariable +class /*LIBARDOUR_API*/ ConfigVariableWithMutation : public ConfigVariable { public: ConfigVariableWithMutation (std::string name, T val, T (*m)(T)) @@ -193,7 +193,7 @@ class LIBARDOUR_API ConfigVariableWithMutation : public ConfigVariable }; template<> -class LIBARDOUR_API ConfigVariableWithMutation : public ConfigVariable +class /*LIBARDOUR_API*/ ConfigVariableWithMutation : public ConfigVariable { public: ConfigVariableWithMutation (std::string name, std::string val, std::string (*m)(std::string)) diff --git a/libs/ardour/ardour/debug.h b/libs/ardour/ardour/debug.h index c26710b620..d5d81b8772 100644 --- a/libs/ardour/ardour/debug.h +++ b/libs/ardour/ardour/debug.h @@ -35,6 +35,7 @@ namespace PBD { LIBARDOUR_API extern uint64_t SnapBBT; LIBARDOUR_API extern uint64_t Configuration; LIBARDOUR_API extern uint64_t Latency; + LIBARDOUR_API extern uint64_t Peaks; LIBARDOUR_API extern uint64_t Processors; LIBARDOUR_API extern uint64_t ProcessThreads; LIBARDOUR_API extern uint64_t Graph; diff --git a/libs/ardour/ardour/directory_names.h b/libs/ardour/ardour/directory_names.h index 9eb2254219..04f2d3fe74 100644 --- a/libs/ardour/ardour/directory_names.h +++ b/libs/ardour/ardour/directory_names.h @@ -38,6 +38,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; diff --git a/libs/ardour/ardour/export_format_base.h b/libs/ardour/ardour/export_format_base.h index 7ffb433e1a..7f09d148fe 100644 --- a/libs/ardour/ardour/export_format_base.h +++ b/libs/ardour/ardour/export_format_base.h @@ -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) { } diff --git a/libs/ardour/ardour/filesystem_paths.h b/libs/ardour/ardour/filesystem_paths.h index b96cd05137..0bf25c5153 100644 --- a/libs/ardour/ardour/filesystem_paths.h +++ b/libs/ardour/ardour/filesystem_paths.h @@ -43,14 +43,14 @@ namespace ARDOUR { * @return the search path to be used when looking for per-system * configuration files. This may include user configuration files. */ - LIBARDOUR_API PBD::SearchPath ardour_config_search_path (); + LIBARDOUR_API PBD::Searchpath ardour_config_search_path (); /** * @return the search path to be used when looking for data files * that could be shared by systems (h/w and configuration independent * files, such as icons, XML files, etc) */ - LIBARDOUR_API PBD::SearchPath ardour_data_search_path (); + LIBARDOUR_API PBD::Searchpath ardour_data_search_path (); } // namespace ARDOUR diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h index 98743969f7..bc3f29f92a 100644 --- a/libs/ardour/ardour/midi_model.h +++ b/libs/ardour/ardour/midi_model.h @@ -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 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 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 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, const std::string &); PatchChangeDiffCommand (boost::shared_ptr, const XMLNode &); diff --git a/libs/ardour/ardour/midi_ring_buffer.h b/libs/ardour/ardour/midi_ring_buffer.h index 2d35be679f..78d14b9185 100644 --- a/libs/ardour/ardour/midi_ring_buffer.h +++ b/libs/ardour/ardour/midi_ring_buffer.h @@ -41,7 +41,7 @@ class MidiBuffer; * [timestamp][type][size][size bytes of raw MIDI][timestamp][type][size](etc...) */ template -class LIBARDOUR_API MidiRingBuffer : public Evoral::EventRingBuffer { +class /*LIBARDOUR_API*/ MidiRingBuffer : public Evoral::EventRingBuffer { public: /** @param size Size in bytes. */ diff --git a/libs/ardour/ardour/monitor_processor.h b/libs/ardour/ardour/monitor_processor.h index 41e911f57c..33b3e9c366 100644 --- a/libs/ardour/ardour/monitor_processor.h +++ b/libs/ardour/ardour/monitor_processor.h @@ -39,7 +39,7 @@ namespace ARDOUR { class Session; template -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) diff --git a/libs/ardour/ardour/revision.h b/libs/ardour/ardour/revision.h index 849a96fa07..7374c0839b 100644 --- a/libs/ardour/ardour/revision.h +++ b/libs/ardour/ardour/revision.h @@ -23,7 +23,12 @@ #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 diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 381f9fbf4b..1e3c41fe1d 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -140,7 +140,7 @@ class WindowsVSTPlugin; extern void setup_enum_writer (); -class LIBARDOUR_API LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionList, public SessionEventManager +class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionList, public SessionEventManager { public: enum RecordState { @@ -237,7 +237,7 @@ class LIBARDOUR_API LIBARDOUR_API Session : public PBD::StatefulDestructible, pu return _bundles.reader (); } - struct RoutePublicOrderSorter { + struct LIBARDOUR_API RoutePublicOrderSorter { bool operator() (boost::shared_ptr, boost::shared_ptr b); }; diff --git a/libs/ardour/ardour/visibility.h b/libs/ardour/ardour/visibility.h index b702e94edb..7f79dd6f2e 100644 --- a/libs/ardour/ardour/visibility.h +++ b/libs/ardour/ardour/visibility.h @@ -20,6 +20,8 @@ #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 @@ -35,17 +37,14 @@ #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) +#elif !defined(LIBARDOUR_APICALLTYPE) // Other compilers / platforms could be accommodated here (as an example, see LIBARDOUR_HELPER_DLL, below) - #define LIBARDOUR_API #define LIBARDOUR_APICALLTYPE #endif From b5e9e7c04c6f0514dcdf3be8e02eb1ce75dd8fb8 Mon Sep 17 00:00:00 2001 From: John Emmas Date: Mon, 20 Jan 2014 17:01:58 +0000 Subject: [PATCH 2/3] 'libs/gtkmm2ext' - DLL visibility stuff and associated changes needed for building with MSVC. Currently includes debugging information and things that are just commented out until we have known compatibility with the other platforms (i.e. contains stuff to be removed at a later date) --- libs/gtkmm2ext/gtkmm2ext/dndtreeview.h | 4 ++-- libs/gtkmm2ext/gtkmm2ext/dndvbox.h | 4 ++-- libs/gtkmm2ext/gtkmm2ext/doi.h | 6 +++--- libs/gtkmm2ext/gtkmm2ext/utils.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h b/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h index 4a3eb7b5cf..d82688c9c2 100644 --- a/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h +++ b/libs/gtkmm2ext/gtkmm2ext/dndtreeview.h @@ -31,7 +31,7 @@ namespace Gtkmm2ext { template -struct LIBGTKMM2EXT_API SerializedObjectPointers { +struct /*LIBGTKMM2EXT_API*/ SerializedObjectPointers { uint32_t size; uint32_t cnt; char type[32]; @@ -89,7 +89,7 @@ class LIBGTKMM2EXT_API DnDTreeViewBase : public Gtk::TreeView }; template -class LIBGTKMM2EXT_API DnDTreeView : public DnDTreeViewBase +class /*LIBGTKMM2EXT_API*/ DnDTreeView : public DnDTreeViewBase { public: DnDTreeView() {} diff --git a/libs/gtkmm2ext/gtkmm2ext/dndvbox.h b/libs/gtkmm2ext/gtkmm2ext/dndvbox.h index e41437fbcc..da6690f5f9 100644 --- a/libs/gtkmm2ext/gtkmm2ext/dndvbox.h +++ b/libs/gtkmm2ext/gtkmm2ext/dndvbox.h @@ -25,7 +25,7 @@ namespace Gtkmm2ext { /** Parent class for children of a DnDVBox */ -class LIBGTKMM2EXT_API DnDVBoxChild +class /*LIBGTKMM2EXT_API*/ DnDVBoxChild { public: virtual ~DnDVBoxChild () {} @@ -45,7 +45,7 @@ public: /** A VBox whose contents can be dragged and dropped */ template -class LIBGTKMM2EXT_API DnDVBox : public Gtk::EventBox +class /*LIBGTKMM2EXT_API*/ DnDVBox : public Gtk::EventBox { public: DnDVBox () : _active (0), _drag_icon (0), _expecting_unwanted_button_event (false), _placeholder (0) diff --git a/libs/gtkmm2ext/gtkmm2ext/doi.h b/libs/gtkmm2ext/gtkmm2ext/doi.h index 53c24847f3..bdd83ad3e9 100644 --- a/libs/gtkmm2ext/gtkmm2ext/doi.h +++ b/libs/gtkmm2ext/gtkmm2ext/doi.h @@ -30,11 +30,11 @@ /* XXX g++ 2.95 can't compile this as pair of member function templates */ -template LIBGTKMM2EXT_API gint idle_delete (T *obj) { delete obj; return FALSE; } -template LIBGTKMM2EXT_API void delete_when_idle (T *obj) { +template /*LIBGTKMM2EXT_API*/ gint idle_delete (T *obj) { delete obj; return FALSE; } +template /*LIBGTKMM2EXT_API*/ void delete_when_idle (T *obj) { Glib::signal_idle().connect (sigc::bind (sigc::ptr_fun (idle_delete), obj)); } -template LIBGTKMM2EXT_API gint delete_on_unmap (GdkEventAny *ignored, T *obj) { +template /*LIBGTKMM2EXT_API*/ gint delete_on_unmap (GdkEventAny *ignored, T *obj) { Glib::signal_idle().connect (sigc::bind (sigc::ptr_fun (idle_delete), obj)); return FALSE; } diff --git a/libs/gtkmm2ext/gtkmm2ext/utils.h b/libs/gtkmm2ext/gtkmm2ext/utils.h index 7d161e2518..de939bb136 100644 --- a/libs/gtkmm2ext/gtkmm2ext/utils.h +++ b/libs/gtkmm2ext/gtkmm2ext/utils.h @@ -75,7 +75,7 @@ namespace Gtkmm2ext { LIBGTKMM2EXT_API void set_popdown_strings (Gtk::ComboBoxText&, const std::vector&); - template LIBGTKMM2EXT_API void deferred_delete (void *ptr) { + template /*LIBGTKMM2EXT_API*/ void deferred_delete (void *ptr) { delete static_cast (ptr); } From bd16d6afeadc4fc222c3fca1a10911e090912856 Mon Sep 17 00:00:00 2001 From: John Emmas Date: Mon, 20 Jan 2014 17:51:53 +0000 Subject: [PATCH 3/3] I thought I'd committed these changes to 'windows+cc' but I must have forgot.... --- libs/ardour/ardour/ardour.h | 2 +- libs/ardour/ardour/revision.h | 2 +- libs/ardour/ardour/visibility.h | 73 --------------------------------- 3 files changed, 2 insertions(+), 75 deletions(-) delete mode 100644 libs/ardour/ardour/visibility.h diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h index 5e747f5665..f21d62c6b7 100644 --- a/libs/ardour/ardour/ardour.h +++ b/libs/ardour/ardour/ardour.h @@ -68,7 +68,7 @@ namespace ARDOUR { extern LIBARDOUR_API PBD::PropertyChange bounds_change; - extern /*LIBARDOUR_API*/ const char* const ardour_config_info; + extern LIBARDOUR_API const char* const ardour_config_info; LIBARDOUR_API void find_bindings_files (std::map&); diff --git a/libs/ardour/ardour/revision.h b/libs/ardour/ardour/revision.h index 7374c0839b..ed4059cbf9 100644 --- a/libs/ardour/ardour/revision.h +++ b/libs/ardour/ardour/revision.h @@ -24,7 +24,7 @@ namespace ARDOUR { - /*LIBARDOUR_API extern*/ extern const char* revision; + LIBARDOUR_API extern const char* revision; extern "C" { LIBARDOUR_API const char* get_ardour_revision(); diff --git a/libs/ardour/ardour/visibility.h b/libs/ardour/ardour/visibility.h deleted file mode 100644 index 7f79dd6f2e..0000000000 --- a/libs/ardour/ardour/visibility.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - 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__ */