diff --git a/doc/changelog.qbk b/doc/changelog.qbk index 54be1cb9f..dd75471a2 100644 --- a/doc/changelog.qbk +++ b/doc/changelog.qbk @@ -9,6 +9,10 @@ [section:changelog Changelog] +[heading 2.31, Boost 1.88] + +* Disabled usage of `std::codecvt` and `std::codecvt` locale facets in C++20 and later modes as they were deprecated in C++20. This means character code conversions to/from `char16_t` and `char32_t` is no longer available in C++20 and later. + [heading 2.30, Boost 1.87] * Replaced __boost_thread__ synchronization primitives with equivalents from the C++ standard library. This may improve multithreaded performance, but also has user-facing consequences: diff --git a/include/boost/log/detail/config.hpp b/include/boost/log/detail/config.hpp index 7835a5b4b..0e69949ff 100644 --- a/include/boost/log/detail/config.hpp +++ b/include/boost/log/detail/config.hpp @@ -92,12 +92,14 @@ # define BOOST_LOG_BROKEN_CONSTANT_EXPRESSIONS #endif -#if (defined(BOOST_NO_CXX11_HDR_CODECVT) && BOOST_CXX_VERSION < 201703) || (defined(_MSVC_STL_VERSION) && _MSVC_STL_VERSION < 142) +#if (defined(BOOST_NO_CXX11_HDR_CODECVT) && BOOST_CXX_VERSION < 201703) || (BOOST_CXX_VERSION >= 202002) || \ + (defined(_MSVC_STL_VERSION) && _MSVC_STL_VERSION < 142) // The compiler does not support std::codecvt and std::codecvt specializations. // The BOOST_NO_CXX11_HDR_CODECVT means there's no usable , which is slightly different from this macro. // But in order for to be implemented the std::codecvt specializations have to be implemented as well. // We need to check the C++ version as well, since is deprecated from C++17 onwards which may cause // BOOST_NO_CXX11_HDR_CODECVT to be set, even though std::codecvt in is just fine. + // The std::codecvt and std::codecvt specializations were eventually deprecated in C++20. # define BOOST_LOG_NO_CXX11_CODECVT_FACETS #endif @@ -113,8 +115,8 @@ # include #endif -#if (!defined(__CRYSTAX__) && defined(__ANDROID__) && (__ANDROID_API__ < 21)) \ - || (defined(__VXWORKS__) && !defined(_WRS_CONFIG_USER_MANAGEMENT)) +#if (!defined(__CRYSTAX__) && defined(__ANDROID__) && (__ANDROID_API__ < 21)) || \ + (defined(__VXWORKS__) && !defined(_WRS_CONFIG_USER_MANAGEMENT)) // Until Android API version 21 Google NDK does not provide getpwuid_r # define BOOST_LOG_NO_GETPWUID_R #endif