diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-07-17 08:05:59 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-07-17 08:05:59 -0400 |
commit | 650964f3203319b013c49a286b5fc5fc203f3bbb (patch) | |
tree | 60b2f879d4ed634f9420a737886086db5eb31f78 /libs | |
parent | 9cbe231b920d92a2e44e08962a3ed6870b962f34 (diff) | |
parent | 780397d0ccf8df54eeb78c88eebbaab0c2745029 (diff) |
Merge branch 'master' into windows
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/audio_track.cc | 5 | ||||
-rw-r--r-- | libs/ardour/audio_unit.cc | 2 | ||||
-rw-r--r-- | libs/ardour/io.cc | 4 | ||||
-rw-r--r-- | libs/ardour/kmeterdsp.cc | 19 | ||||
-rw-r--r-- | libs/ardour/ladspa_plugin.cc | 10 | ||||
-rw-r--r-- | libs/ardour/lv2_plugin.cc | 54 | ||||
-rw-r--r-- | libs/ardour/meter.cc | 4 | ||||
-rw-r--r-- | libs/ardour/midi_track.cc | 5 | ||||
-rw-r--r-- | libs/ardour/plugin.cc | 2 | ||||
-rw-r--r-- | libs/ardour/plugin_insert.cc | 6 | ||||
-rw-r--r-- | libs/ardour/route.cc | 11 | ||||
-rw-r--r-- | libs/ardour/track.cc | 48 | ||||
-rw-r--r-- | libs/ardour/vst_plugin.cc | 4 | ||||
-rw-r--r-- | libs/audiographer/audiographer/debug_utils.h | 3 | ||||
-rw-r--r-- | libs/evoral/evoral/PatchChange.hpp | 2 | ||||
-rw-r--r-- | libs/evoral/src/Sequence.cpp | 4 | ||||
-rw-r--r-- | libs/gtkmm2ext/fastmeter.cc | 11 | ||||
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/fastmeter.h | 2 | ||||
-rw-r--r-- | libs/gtkmm2ext/persistent_tooltip.cc | 3 | ||||
-rw-r--r-- | libs/pbd/pbd/stl_delete.h | 10 |
20 files changed, 158 insertions, 51 deletions
diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index b4ca9e2df8..4b33bbd4c6 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -325,6 +325,9 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram if (!_active) { silence (nframes); + if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) { + _meter->reset(); + } return 0; } @@ -354,7 +357,7 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram fill_buffers_with_input (bufs, _input, nframes); - if (_meter_point == MeterInput) { + if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) { _meter->run (bufs, start_frame, end_frame, nframes, true); } diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index ea2e93c5a0..9c86b87415 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -1717,6 +1717,7 @@ AUPlugin::set_state(const XMLNode& node, int version) return -1; } +#ifndef NO_PLUGIN_STATE if (node.children().empty()) { return -1; } @@ -1752,6 +1753,7 @@ AUPlugin::set_state(const XMLNode& node, int version) } CFRelease (propertyList); } +#endif Plugin::set_state (node, version); return ret; diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 4e080b06d8..1349d49a0c 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -1645,7 +1645,9 @@ IO::process_input (boost::shared_ptr<Processor> proc, framepos_t start_frame, fr } _buffers.get_jack_port_addresses (_ports, nframes); - proc->run (_buffers, start_frame, end_frame, nframes, true); + if (proc) { + proc->run (_buffers, start_frame, end_frame, nframes, true); + } } void diff --git a/libs/ardour/kmeterdsp.cc b/libs/ardour/kmeterdsp.cc index 77d1a87a81..afd0f71719 100644 --- a/libs/ardour/kmeterdsp.cc +++ b/libs/ardour/kmeterdsp.cc @@ -46,12 +46,6 @@ void Kmeterdsp::process (float *p, int n) float s, t, z1, z2; - if (_flag) // Display thread has read the rms value. - { - _rms = 0; - _flag = false; - } - // Get filter state. z1 = _z1; z2 = _z2; @@ -88,9 +82,18 @@ void Kmeterdsp::process (float *p, int n) _z1 = z1 + 1e-20f; _z2 = z2 + 1e-20f; - // Adjust RMS value and update maximum since last read(). s = sqrtf (2 * z2); - if (s > _rms) _rms = s; + + if (_flag) // Display thread has read the rms value. + { + _rms = s; + _flag = false; + } + else + { + // Adjust RMS value and update maximum since last read(). + if (s > _rms) _rms = s; + } } diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc index 6ee810f6b1..82bf97264f 100644 --- a/libs/ardour/ladspa_plugin.cc +++ b/libs/ardour/ladspa_plugin.cc @@ -40,6 +40,7 @@ #include "pbd/compose.h" #include "pbd/error.h" #include "pbd/xml++.h" +#include "pbd/stacktrace.h" #include "midi++/manager.h" @@ -372,6 +373,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version) return set_state_2X (node, version); } +#ifndef NO_PLUGIN_STATE XMLNodeList nodes; XMLProperty *prop; XMLNodeConstIterator iter; @@ -379,6 +381,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version) const char *port; const char *data; uint32_t port_id; +#endif LocaleGuard lg (X_("POSIX")); if (node.name() != state_node_name()) { @@ -386,6 +389,8 @@ LadspaPlugin::set_state (const XMLNode& node, int version) return -1; } +#ifndef NO_PLUGIN_STATE + nodes = node.children ("Port"); for (iter = nodes.begin(); iter != nodes.end(); ++iter) { @@ -408,6 +413,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version) sscanf (port, "%" PRIu32, &port_id); set_parameter (port_id, atof(data)); } +#endif latency_compute_run (); @@ -417,6 +423,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version) int LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */) { +#ifndef NO_PLUGIN_STATE XMLNodeList nodes; XMLProperty *prop; XMLNodeConstIterator iter; @@ -424,6 +431,7 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */) const char *port; const char *data; uint32_t port_id; +#endif LocaleGuard lg (X_("POSIX")); if (node.name() != state_node_name()) { @@ -431,6 +439,7 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */) return -1; } +#ifndef NO_PLUGIN_STATE nodes = node.children ("port"); for(iter = nodes.begin(); iter != nodes.end(); ++iter){ @@ -455,6 +464,7 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */) } latency_compute_run (); +#endif return 0; } diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index c5a02575fd..2f46db75a6 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -113,6 +113,8 @@ public: LV2World (); ~LV2World (); + void load_bundled_plugins(); + LilvWorld* world; LilvNode* atom_AtomPort; @@ -141,6 +143,9 @@ public: LilvNode* time_Position; LilvNode* ui_GtkUI; LilvNode* ui_external; + +private: + bool _bundle_checked; }; static LV2World _world; @@ -1229,6 +1234,8 @@ LV2Plugin::set_state(const XMLNode& node, int version) return -1; } +#ifndef NO_PLUGIN_STATE + if (version < 3000) { nodes = node.children("port"); } else { @@ -1284,6 +1291,7 @@ LV2Plugin::set_state(const XMLNode& node, int version) } latency_compute_run(); +#endif return Plugin::set_state(node, version); } @@ -1904,27 +1912,10 @@ static bool lv2_filter (const string& str, void *arg) LV2World::LV2World() : world(lilv_world_new()) + , _bundle_checked(false) { lilv_world_load_all(world); - cout << "Scanning folders for bundled LV2s: " << ARDOUR::lv2_bundled_search_path().to_string() << endl; - PathScanner scanner; - vector<string *> *plugin_objects = scanner (ARDOUR::lv2_bundled_search_path().to_string(), lv2_filter, 0, true, true); - if (plugin_objects) { - for ( vector<string *>::iterator x = plugin_objects->begin(); x != plugin_objects->end (); ++x) { -#ifdef WINDOWS - string uri = "file:///" + **x + "/"; -#else - string uri = "file://" + **x + "/"; -#endif - LilvNode *node = lilv_new_uri(world, uri.c_str()); - lilv_world_load_bundle(world, node); - lilv_node_free(node); - } - } - delete (plugin_objects); - - atom_AtomPort = lilv_new_uri(world, LV2_ATOM__AtomPort); atom_Chunk = lilv_new_uri(world, LV2_ATOM__Chunk); atom_Sequence = lilv_new_uri(world, LV2_ATOM__Sequence); @@ -1983,6 +1974,31 @@ LV2World::~LV2World() lilv_node_free(atom_AtomPort); } +void +LV2World::load_bundled_plugins() +{ + if (!_bundle_checked) { + cout << "Scanning folders for bundled LV2s: " << ARDOUR::lv2_bundled_search_path().to_string() << endl; + PathScanner scanner; + vector<string *> *plugin_objects = scanner (ARDOUR::lv2_bundled_search_path().to_string(), lv2_filter, 0, true, true); + if (plugin_objects) { + for ( vector<string *>::iterator x = plugin_objects->begin(); x != plugin_objects->end (); ++x) { +#ifdef WINDOWS + string uri = "file:///" + **x + "/"; +#else + string uri = "file://" + **x + "/"; +#endif + LilvNode *node = lilv_new_uri(world, uri.c_str()); + lilv_world_load_bundle(world, node); + lilv_node_free(node); + } + } + delete (plugin_objects); + + _bundle_checked = true; + } +} + LV2PluginInfo::LV2PluginInfo (const void* c_plugin) : _c_plugin(c_plugin) { @@ -2014,6 +2030,8 @@ LV2PluginInfo::load(Session& session) PluginInfoList* LV2PluginInfo::discover() { + _world.load_bundled_plugins(); + PluginInfoList* plugs = new PluginInfoList; const LilvPlugins* plugins = lilv_world_get_all_plugins(_world.world); diff --git a/libs/ardour/meter.cc b/libs/ardour/meter.cc index 304bffe5c9..3d1ab61bbc 100644 --- a/libs/ardour/meter.cc +++ b/libs/ardour/meter.cc @@ -116,6 +116,10 @@ PeakMeter::reset () for (size_t i = 0; i < _peak_signal.size(); ++i) { _peak_signal[i] = 0.0f; } + + for (size_t n = 0; n < _kmeter.size(); ++n) { + _kmeter[n]->reset(); + } } void diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index 51edd06aee..7c4ae24a2a 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -329,6 +329,9 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame if (!_active) { silence (nframes); + if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) { + _meter->reset(); + } return 0; } @@ -353,7 +356,7 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame fill_buffers_with_input (bufs, _input, nframes); - if (_meter_point == MeterInput) { + if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) { _meter->run (bufs, start_frame, end_frame, nframes, true); } diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc index ec9e333285..5e0e020bd1 100644 --- a/libs/ardour/plugin.cc +++ b/libs/ardour/plugin.cc @@ -397,7 +397,7 @@ Plugin::get_state () add_state (root); #else if (!seen_get_state_message) { - info << string_compose (_("Saving AudioUnit settings is not supported in this build of %1. Consider paying for a newer version"), + info << string_compose (_("Saving plugin settings is not supported in this build of %1. Consider paying for the full version"), PROGRAM_NAME) << endmsg; seen_get_state_message = true; diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 23cebf4276..998a03e3aa 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -882,7 +882,12 @@ PluginInsert::set_control_ids (const XMLNode& node, int version) if ((prop = (*iter)->property (X_("parameter"))) != 0) { uint32_t p = atoi (prop->value()); + + /* this may create the new controllable */ + boost::shared_ptr<Evoral::Control> c = control (Evoral::Parameter (PluginAutomation, 0, p)); + +#ifndef NO_PLUGIN_STATE if (!c) { continue; } @@ -890,6 +895,7 @@ PluginInsert::set_control_ids (const XMLNode& node, int version) if (ac) { ac->set_state (**iter, version); } +#endif } } } diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index c6f588a79c..797481b7b8 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -2562,21 +2562,10 @@ Route::set_processor_state (const XMLNode& node) continue; } -#ifndef NO_PLUGIN_STATE if (processor->set_state (**niter, Stateful::current_state_version) != 0) { /* This processor could not be configured. Turn it into a UnknownProcessor */ processor.reset (new UnknownProcessor (_session, **niter)); } -#else - if (boost::dynamic_pointer_cast<PluginInsert>(processor)) { - if (processor->set_state (**niter, Stateful::current_state_version) != 0) { - /* This processor could not be configured. Turn it into a UnknownProcessor */ - processor.reset (new UnknownProcessor (_session, **niter)); - } - } else { - /* plugin, but ::set_state() not * allowed no message here - things will get too verbose */ - } -#endif /* we have to note the monitor send here, otherwise a new one will be created and the state of this one will be lost. diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index 6d153e1cbf..c6a348ddfb 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -347,6 +347,9 @@ Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, if (!_active) { silence (nframes); + if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) { + _meter->reset(); + } return 0; } @@ -405,8 +408,39 @@ Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, if (be_silent) { if (_meter_point == MeterInput) { - /* still need input monitoring */ - _input->process_input (_meter, start_frame, end_frame, nframes); + /* still need input monitoring and metering */ + + bool const track_rec = _diskstream->record_enabled (); + bool const auto_input = _session.config.get_auto_input (); + bool const software_monitor = Config->get_monitoring_model() == SoftwareMonitoring; + bool const tape_machine_mode = Config->get_tape_machine_mode (); + bool no_meter = false; + + /* this needs a proper K-map + * and should be separated into a function similar to monitoring_state() + * that also handles roll() states in audio_track.cc, midi_track.cc and route.cc + * + * see http://www.oofus.co.uk/ardour/Ardour3MonitorModesV3.pdf + */ + if (!auto_input && !track_rec) { + no_meter=true; + } + else if (tape_machine_mode && !track_rec && auto_input) { + no_meter=true; + } + else if (!software_monitor && tape_machine_mode && !track_rec) { + no_meter=true; + } + else if (!software_monitor && !tape_machine_mode && !track_rec && !auto_input) { + no_meter=true; + } + + if (no_meter) { + _meter->reset(); + _input->process_input (boost::shared_ptr<Processor>(), start_frame, end_frame, nframes); + } else { + _input->process_input (_meter, start_frame, end_frame, nframes); + } } passthru_silence (start_frame, end_frame, nframes, 0); @@ -945,6 +979,14 @@ Track::set_monitoring (MonitorChoice mc) MeterState Track::metering_state () const { - return (_diskstream->record_enabled() || _meter_point == MeterInput) ? MeteringInput : MeteringRoute; + bool rv; + if (_session.transport_rolling ()) { + // audio_track.cc || midi_track.cc roll() runs meter IFF: + rv = _meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled()); + } else { + // track no_roll() always metering if + rv = _meter_point == MeterInput; + } + return rv ? MeteringInput : MeteringRoute; } diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc index c385e71a5a..b80a594495 100644 --- a/libs/ardour/vst_plugin.cc +++ b/libs/ardour/vst_plugin.cc @@ -197,14 +197,15 @@ int VSTPlugin::set_state (const XMLNode& node, int version) { LocaleGuard lg (X_("POSIX")); + int ret = -1; if (node.name() != state_node_name()) { error << _("Bad node sent to VSTPlugin::set_state") << endmsg; return 0; } +#ifndef NO_PLUGIN_STATE XMLNode* child; - int ret = -1; if ((child = find_named_node (node, X_("chunk"))) != 0) { @@ -237,6 +238,7 @@ VSTPlugin::set_state (const XMLNode& node, int version) ret = 0; } +#endif Plugin::set_state (node, version); return ret; diff --git a/libs/audiographer/audiographer/debug_utils.h b/libs/audiographer/audiographer/debug_utils.h index 7b9e50124a..693c50064c 100644 --- a/libs/audiographer/audiographer/debug_utils.h +++ b/libs/audiographer/audiographer/debug_utils.h @@ -3,6 +3,7 @@ #include "flag_field.h" +#include <cstdlib> #include <string> #ifdef __GNUC__ @@ -25,7 +26,7 @@ struct DebugUtils char * res = abi::__cxa_demangle (typeid(obj).name(), 0, 0, &status); if (status == 0) { std::string s(res); - free (res); + std::free (res); return s; } #endif diff --git a/libs/evoral/evoral/PatchChange.hpp b/libs/evoral/evoral/PatchChange.hpp index b1a42c6f2e..53b50a3383 100644 --- a/libs/evoral/evoral/PatchChange.hpp +++ b/libs/evoral/evoral/PatchChange.hpp @@ -123,7 +123,7 @@ public: return time() < o.time(); } - if (bank != o.bank()) { + if (bank() != o.bank()) { return bank() < o.bank(); } diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp index b56c234d75..204ef58f33 100644 --- a/libs/evoral/src/Sequence.cpp +++ b/libs/evoral/src/Sequence.cpp @@ -24,6 +24,10 @@ #include <stdint.h> #include <cstdio> +#if __clang__ +#include "evoral/Note.hpp" +#endif + #include "pbd/compose.h" #include "pbd/error.h" diff --git a/libs/gtkmm2ext/fastmeter.cc b/libs/gtkmm2ext/fastmeter.cc index c0bcb05af5..6ea1a6dd4b 100644 --- a/libs/gtkmm2ext/fastmeter.cc +++ b/libs/gtkmm2ext/fastmeter.cc @@ -23,6 +23,8 @@ #include <algorithm> #include <cstring> +#include <stdlib.h> + #include <gdkmm/rectangle.h> #include <gtkmm2ext/fastmeter.h> #include <gtkmm2ext/utils.h> @@ -37,6 +39,7 @@ using namespace std; int FastMeter::min_pattern_metric_size = 16; int FastMeter::max_pattern_metric_size = 1024; +bool FastMeter::no_rgba_overlay = false; FastMeter::Pattern10Map FastMeter::vm_pattern_cache; FastMeter::PatternBgMap FastMeter::vb_pattern_cache; @@ -61,6 +64,7 @@ FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o, int len, last_peak_rect.height = 0; highlight = false; + no_rgba_overlay = ! Glib::getenv("NO_METER_SHADE").empty(); _clr[0] = clr0; _clr[1] = clr1; @@ -173,7 +177,7 @@ FastMeter::generate_meter_pattern ( cairo_pattern_add_color_stop_rgb (pat, 1.0, r/255.0, g/255.0, b/255.0); - if (shade) { + if (shade && !no_rgba_overlay) { cairo_pattern_t* shade_pattern = cairo_pattern_create_linear (0.0, 0.0, width, 0.0); cairo_pattern_add_color_stop_rgba (shade_pattern, 0, 1.0, 1.0, 1.0, 0.2); cairo_pattern_add_color_stop_rgba (shade_pattern, 1, 0.0, 0.0, 0.0, 0.3); @@ -221,7 +225,7 @@ FastMeter::generate_meter_background ( cairo_pattern_add_color_stop_rgb (pat, 1.0, r0/255.0, g0/255.0, b0/255.0); - if (shade) { + if (shade && !no_rgba_overlay) { cairo_pattern_t* shade_pattern = cairo_pattern_create_linear (0.0, 0.0, width, 0.0); cairo_pattern_add_color_stop_rgba (shade_pattern, 0.0, 1.0, 1.0, 1.0, 0.15); cairo_pattern_add_color_stop_rgba (shade_pattern, 0.6, 0.0, 0.0, 0.0, 0.10); @@ -417,7 +421,8 @@ FastMeter::vertical_expose (GdkEventExpose* ev) cairo_set_source (cr, fgpattern->cobj()); cairo_rectangle (cr, 1, last_peak_rect.y, pixwidth, last_peak_rect.height); - if (bright_hold) { + + if (bright_hold && !no_rgba_overlay) { cairo_fill_preserve (cr); cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.3); } diff --git a/libs/gtkmm2ext/gtkmm2ext/fastmeter.h b/libs/gtkmm2ext/gtkmm2ext/fastmeter.h index f065020a57..15c962deb4 100644 --- a/libs/gtkmm2ext/gtkmm2ext/fastmeter.h +++ b/libs/gtkmm2ext/gtkmm2ext/fastmeter.h @@ -96,6 +96,8 @@ private: bool vertical_expose (GdkEventExpose*); void queue_vertical_redraw (const Glib::RefPtr<Gdk::Window>&, float); + static bool no_rgba_overlay; + static Cairo::RefPtr<Cairo::Pattern> generate_meter_pattern ( int w, int h, int *clr, float *stp, bool shade); static Cairo::RefPtr<Cairo::Pattern> request_vertical_meter ( diff --git a/libs/gtkmm2ext/persistent_tooltip.cc b/libs/gtkmm2ext/persistent_tooltip.cc index ea0ffd63e9..77a8d94c0f 100644 --- a/libs/gtkmm2ext/persistent_tooltip.cc +++ b/libs/gtkmm2ext/persistent_tooltip.cc @@ -48,6 +48,9 @@ PersistentTooltip::~PersistentTooltip () bool PersistentTooltip::enter (GdkEventCrossing *) { + if (_timeout.connected()) { + leave(NULL); + } _timeout = Glib::signal_timeout().connect (sigc::mem_fun (*this, &PersistentTooltip::timeout), 500); return false; } diff --git a/libs/pbd/pbd/stl_delete.h b/libs/pbd/pbd/stl_delete.h index 66fb027387..ac2161560c 100644 --- a/libs/pbd/pbd/stl_delete.h +++ b/libs/pbd/pbd/stl_delete.h @@ -20,11 +20,19 @@ #ifndef __libmisc_stl_delete_h__ #define __libmisc_stl_delete_h__ + +#if __clang__ && __APPLE__ && __cplusplus >= 201103L +#include <vector> +#ifndef _CPP_VECTOR +#define _CPP_VECTOR +#endif +#endif + /* To actually use any of these deletion functions, you need to first include the revelant container type header. */ #if defined(_CPP_VECTOR) || defined(_GLIBCXX_VECTOR) || defined(__SGI_STL_VECTOR) -template<class T> void vector_delete (std::vector<T *> *vec) +template<class T> void vector_delete (std::vector<T *> *vec) { typename std::vector<T *>::iterator i; |