diff options
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/chan_mapping.h | 11 | ||||
-rw-r--r-- | libs/ardour/ardour/plugin_insert.h | 12 |
2 files changed, 22 insertions, 1 deletions
diff --git a/libs/ardour/ardour/chan_mapping.h b/libs/ardour/ardour/chan_mapping.h index cc42ed01bc..7a4d41123e 100644 --- a/libs/ardour/ardour/chan_mapping.h +++ b/libs/ardour/ardour/chan_mapping.h @@ -104,8 +104,19 @@ public: */ bool is_subset (const ChanMapping& superset) const; +#if defined(_MSC_VER) && (_MSC_VER < 1900) + /* Use the older (heap based) mapping for early versions of MSVC. + * In fact it might be safer to use this for all MSVC builds - as + * our StackAllocator class depends on 'boost::aligned_storage' + * which is known to be troublesome with Visual C++ :- + * https://www.boost.org/doc/libs/1_65_0/libs/type_traits/doc/html/boost_typetraits/reference/aligned_storage.html + */ + typedef std::map<uint32_t, uint32_t> TypeMapping; + typedef std::map<DataType, TypeMapping> Mappings; +#else typedef std::map<uint32_t, uint32_t, std::less<uint32_t>, PBD::StackAllocator<std::pair<const uint32_t, uint32_t>, 16> > TypeMapping; typedef std::map<DataType, TypeMapping, std::less<DataType>, PBD::StackAllocator<std::pair<const DataType, TypeMapping>, 2> > Mappings; +#endif Mappings mappings() { return _mappings; } const Mappings& mappings() const { return _mappings; } diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h index 003df28a38..3beaef9a15 100644 --- a/libs/ardour/ardour/plugin_insert.h +++ b/libs/ardour/ardour/plugin_insert.h @@ -371,7 +371,17 @@ private: /* ordered map [plugin instance ID] => ARDOUR::ChanMapping * TODO: consider replacing with boost::flat_map<> or std::vector<>. */ - class PinMappings : public std::map <uint32_t, ARDOUR::ChanMapping, std::less<uint32_t>, PBD::StackAllocator<std::pair<const uint32_t, ARDOUR::ChanMapping>, 4> > +#if defined(_MSC_VER) && (_MSC_VER < 1900) + /* Use the older (heap based) mapping for early versions of MSVC. + * In fact it might be safer to use this for all MSVC builds - as + * our StackAllocator class depends on 'boost::aligned_storage' + * which is known to be troublesome with Visual C++ :- + * https://www.boost.org/doc/libs/1_65_0/libs/type_traits/doc/html/boost_typetraits/reference/aligned_storage.html + */ + class PinMappings : public std::map <uint32_t, ARDOUR::ChanMapping> +#else + class PinMappings : public std::map <uint32_t, ARDOUR::ChanMapping, std::less<uint32_t>, PBD::StackAllocator<std::pair<const uint32_t, ARDOUR::ChanMapping>, 4> > +#endif { public: /* this emulates C++11's std::map::at() |