From 8588eb21975b0f65b27f09e75d40331ab7e4323a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Mon, 16 Jun 2025 09:54:11 +0200 Subject: [PATCH] Add a define to optionally suppress usage of std::source_location --- include/toml11/compat.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/toml11/compat.hpp b/include/toml11/compat.hpp index 41d3617..cc6aef3 100644 --- a/include/toml11/compat.hpp +++ b/include/toml11/compat.hpp @@ -448,13 +448,13 @@ using void_t = void; // ---------------------------------------------------------------------------- // (subset of) source_location -#if TOML11_CPLUSPLUS_STANDARD_VERSION >= 202002L +#if ! defined(TOML11_DISABLE_SOURCE_LOCATION) && TOML11_CPLUSPLUS_STANDARD_VERSION >= 202002L # if __has_include() # define TOML11_HAS_STD_SOURCE_LOCATION # endif // has_include #endif // c++20 -#if ! defined(TOML11_HAS_STD_SOURCE_LOCATION) +#if ! defined(TOML11_DISABLE_SOURCE_LOCATION) && ! defined(TOML11_HAS_STD_SOURCE_LOCATION) # if defined(__GNUC__) && ! defined(__clang__) # if TOML11_CPLUSPLUS_STANDARD_VERSION >= TOML11_CXX14_VALUE # if __has_include() @@ -464,7 +464,7 @@ using void_t = void; # endif // GNU g++ #endif // not TOML11_HAS_STD_SOURCE_LOCATION -#if ! defined(TOML11_HAS_STD_SOURCE_LOCATION) && ! defined(TOML11_HAS_EXPERIMENTAL_SOURCE_LOCATION) +#if ! defined(TOML11_DISABLE_SOURCE_LOCATION) && ! defined(TOML11_HAS_STD_SOURCE_LOCATION) && ! defined(TOML11_HAS_EXPERIMENTAL_SOURCE_LOCATION) # if defined(__GNUC__) && ! defined(__clang__) # if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) # define TOML11_HAS_BUILTIN_FILE_LINE 1