diff options
author | John Emmas <john@creativepost.co.uk> | 2020-03-10 12:28:52 +0000 |
---|---|---|
committer | John Emmas <john@creativepost.co.uk> | 2020-03-10 12:28:52 +0000 |
commit | 4e137d5cbb85c0344f4135ba6dc39bbf57f90e41 (patch) | |
tree | b9b77bb9dec4d2a2e62ea67fb29814eeca35cdaf /libs/ardour/ardour/plugin_insert.h | |
parent | 9ef5f4d1598d726d5b8380d91af2e546fd1cb2d1 (diff) |
Avoid using 'boost::aligned_storage' which is known to be problematic in MSVC builds:-
https://www.boost.org/doc/libs/1_65_0/libs/type_traits/doc/html/boost_typetraits/reference/aligned_storage.html
Diffstat (limited to 'libs/ardour/ardour/plugin_insert.h')
-rw-r--r-- | libs/ardour/ardour/plugin_insert.h | 12 |
1 files changed, 11 insertions, 1 deletions
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() |