diff --git a/include/boost/container/detail/workaround.hpp b/include/boost/container/detail/workaround.hpp index 736326b..1fea112 100644 --- a/include/boost/container/detail/workaround.hpp +++ b/include/boost/container/detail/workaround.hpp @@ -108,4 +108,15 @@ #define BOOST_CONTAINER_FORCEINLINE BOOST_FORCEINLINE #endif +#if !defined(__has_feature) +#define BOOST_CONTAINER_HAS_FEATURE(feature) 0 +#else +#define BOOST_CONTAINER_HAS_FEATURE(feature) __has_feature(feature) +#endif + +//Detect address sanitizer +#if defined(__SANITIZE_ADDRESS__) || BOOST_CONTAINER_HAS_FEATURE(address_sanitizer) +#define BOOST_CONTAINER_ASAN +#endif + #endif //#ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP