From 447e0b3a331930f8708ade0e42683d12de9dfbc3 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 3 Feb 2024 20:43:55 +0200 Subject: [PATCH] Use __builtin_FUNCSIG() under MSVC 19.35+. Fixes #35. --- include/boost/assert/source_location.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/boost/assert/source_location.hpp b/include/boost/assert/source_location.hpp index a265ad5..c4d5f1b 100644 --- a/include/boost/assert/source_location.hpp +++ b/include/boost/assert/source_location.hpp @@ -144,6 +144,10 @@ template std::basic_ostream & operator<<( std::basic_ost # define BOOST_CURRENT_LOCATION ::boost::source_location() +#elif defined(BOOST_MSVC) && BOOST_MSVC >= 1935 + +# define BOOST_CURRENT_LOCATION ::boost::source_location(__builtin_FILE(), __builtin_LINE(), __builtin_FUNCSIG(), __builtin_COLUMN()) + #elif defined(BOOST_MSVC) && BOOST_MSVC >= 1926 // std::source_location::current() is available in -std:c++20, but fails with consteval errors before 19.31, and doesn't produce