From c0671e0dd4d6499b170f3ae06d67a202d47a2034 Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Mon, 13 Feb 2023 10:39:29 +0000 Subject: [PATCH] Replace fragile and wrong check for library feature. Compiler versions do not imply standard library versions, and even where the compiler and standard library versions were matched, this check was wrong. --- src/snmalloc/ds_core/defines.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/snmalloc/ds_core/defines.h b/src/snmalloc/ds_core/defines.h index 7ddd5691a..54a4d7710 100644 --- a/src/snmalloc/ds_core/defines.h +++ b/src/snmalloc/ds_core/defines.h @@ -109,8 +109,7 @@ namespace snmalloc #define TOSTRING(expr) TOSTRING2(expr) #define TOSTRING2(expr) #expr -#if (defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 11) || \ - (defined(__clang__) && __clang_major__ >= 15) +#ifdef __cpp_lib_source_location # include # define SNMALLOC_CURRENT_LINE std::source_location::current().line() # define SNMALLOC_CURRENT_FILE std::source_location::current().file_name()