From fde226c7f5d579474698444b1c497108044133bc Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 3 Feb 2022 09:31:27 +0200 Subject: [PATCH] Use __cpp_lib_source_location instead of BOOST_NO_CXX20_HDR_SOURCE_LOCATION --- include/boost/assert/source_location.hpp | 4 ++-- test/source_location_test.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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();