From 26f20bd8e5e8ca7b41f24ff87e4c8c6ce24d29b4 Mon Sep 17 00:00:00 2001 From: Nikita Kniazev Date: Tue, 3 Dec 2019 19:35:14 +0300 Subject: [PATCH] Use to determine standard library --- .../boost/config/detail/select_stdlib_config.hpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/include/boost/config/detail/select_stdlib_config.hpp b/include/boost/config/detail/select_stdlib_config.hpp index 8db778c8..1a09dda1 100644 --- a/include/boost/config/detail/select_stdlib_config.hpp +++ b/include/boost/config/detail/select_stdlib_config.hpp @@ -11,10 +11,21 @@ // locate which std lib we are using and define BOOST_STDLIB_CONFIG as needed: -// First include to determine if some version of STLport is in use as the std lib +// First, check if __has_include is available and include can be located, +// otherwise include to determine if some version of STLport is in use as the std lib // (do not rely on this header being included since users can short-circuit this header // if they know whose std lib they are using.) -#ifdef __cplusplus +#if defined(__cplusplus) && defined(__has_include) +# if __has_include() +// It should be safe to include `` when it is present without checking +// the actual C++ language version as it consists solely of macro definitions. +// [version.syn] p1: The header supplies implementation-dependent +// information about the C++ standard library (e.g., version number and release date). +# include +# else +# include +# endif +#elif defined(__cplusplus) # include #else # include