From 56e7a0e49ddb070f63e0943660f7dc6d00f2508c Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 9 Nov 2022 02:14:43 +0200 Subject: [PATCH 1/2] Add macro BOOST_MSSTL_VERSION --- include/boost/config/stdlib/dinkumware.hpp | 30 ++++++++++++++++++++++ test/config_info.cpp | 1 + 2 files changed, 31 insertions(+) diff --git a/include/boost/config/stdlib/dinkumware.hpp b/include/boost/config/stdlib/dinkumware.hpp index 8feccc65..f4ab41fd 100644 --- a/include/boost/config/stdlib/dinkumware.hpp +++ b/include/boost/config/stdlib/dinkumware.hpp @@ -285,6 +285,36 @@ # define BOOST_DINKUMWARE_STDLIB 1 #endif +// BOOST_MSSTL_VERSION: as _MSVC_STL_VERSION, but for earlier releases as well + +#if defined(_MSVC_STL_VERSION) // VS2017 (14.1) and above +# define BOOST_MSSTL_VERSION _MSVC_STL_VERSION + +#elif defined(_CPPLIB_VER) && _CPPLIB_VER >= 650 // VS2015 (14.0) +# define BOOST_MSSTL_VERSION 140 + +#elif defined(_CPPLIB_VER) && _CPPLIB_VER >= 610 // VS2013 (12.0) +# define BOOST_MSSTL_VERSION 120 + +#elif defined(_CPPLIB_VER) && _CPPLIB_VER >= 540 // VS2012 (11.0) +# define BOOST_MSSTL_VERSION 110 + +#elif defined(_CPPLIB_VER) && _CPPLIB_VER >= 520 // VS2010 (10.0) +# define BOOST_MSSTL_VERSION 100 + +#elif defined(_CPPLIB_VER) && _CPPLIB_VER >= 505 // VS2008SP1 (9.0) +# define BOOST_MSSTL_VERSION 91 + +#elif defined(_CPPLIB_VER) && _CPPLIB_VER >= 503 // VS2008 (also 9.0) +# define BOOST_MSSTL_VERSION 90 + +#elif defined(_CPPLIB_VER) && _CPPLIB_VER >= 405 // VS2005 (8.0) +# define BOOST_MSSTL_VERSION 80 + +#endif + +// + #ifdef _CPPLIB_VER # define BOOST_STDLIB "Dinkumware standard library version " BOOST_STRINGIZE(_CPPLIB_VER) #else diff --git a/test/config_info.cpp b/test/config_info.cpp index f2eb7779..eaa819a1 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -1277,6 +1277,7 @@ void print_boost_macros() PRINT_MACRO(BOOST_CLANG); PRINT_MACRO(BOOST_CLANG_VERSION); PRINT_MACRO(BOOST_LIBSTDCXX_VERSION); + PRINT_MACRO(BOOST_MSSTL_VERSION); PRINT_MACRO(BOOST_STD_EXTENSION_NAMESPACE); PRINT_MACRO(BOOST_UNREACHABLE_RETURN(0)); PRINT_MACRO(BOOST_CONSTEXPR); From 7cd570492f7fd5170c190a201cbd05e7d7ad3b2e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 16 Nov 2022 22:25:12 +0200 Subject: [PATCH 2/2] Document BOOST_MSSTL_VERSION --- doc/macro_reference.qbk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk index 0879a07d..9345d704 100644 --- a/doc/macro_reference.qbk +++ b/doc/macro_reference.qbk @@ -1535,6 +1535,13 @@ Defined if the Windows platform API is available. Defined if the dinkumware standard library is in use, takes the same value as the Dinkumware library version macro `_CPPLIB_VER` if defined, otherwise 1. ]] +[[`BOOST_MSSTL_VERSION`][``][ +Defined if the Microsoft Visual C++ standard library is in use. +Has the value of `_MSVC_STL_VERSION` when that is defined, and a synthesized +value of the same format otherwise. Example values are 143 for +VS2022/msvc-14.3, 142 for VS2019/msvc-14.2, 141 for VS2017/msvc-14.1, +140 for VS2015/msvc-14.0, 120 for VS2013/msvc-12.0, and so on. +]] [[`BOOST_NO_WREGEX`][``][ Defined if the regex library does not support wide character regular expressions.