diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index 18db99a..9b46e05 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -14,7 +14,7 @@ #include #include -#if !defined(BOOST_NO_CXX20_HDR_SOURCE_LOCATION) +#if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L # include #endif @@ -40,7 +40,7 @@ public: { } -#if !defined(BOOST_NO_CXX20_HDR_SOURCE_LOCATION) +#if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L BOOST_CONSTEXPR source_location( std::source_location const& loc ) BOOST_NOEXCEPT: file_( loc.file_name() ), function_( loc.function_name() ), line_( loc.line() ), column_( loc.column() ) { diff --git a/test/source_location_test.cpp b/test/source_location_test.cpp index b05dbf6..fc13802 100644 --- a/test/source_location_test.cpp +++ b/test/source_location_test.cpp @@ -25,7 +25,7 @@ int main() BOOST_TEST_EQ( loc.column(), 0 ); } -#if !defined(BOOST_NO_CXX20_HDR_SOURCE_LOCATION) +#if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907L { std::source_location loc = std::source_location::current();