diff --git a/include/spdlog/common.h b/include/spdlog/common.h index 305a9ed4..5bab7216 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -24,7 +24,6 @@ #if __cpp_lib_source_location >= 201907L #include -#define SPDLOG_HAS_STD_SOURCE_LOC #endif #ifdef SPDLOG_USE_STD_FORMAT @@ -307,11 +306,13 @@ struct source_loc , funcname{funcname_in} {} +#if __cpp_lib_source_location >= 201907L SPDLOG_CONSTEXPR source_loc(std::source_location loc) SPDLOG_NOEXCEPT : filename{loc.file_name()} , line{static_cast(loc.line())} , funcname{loc.function_name()} {} +#endif SPDLOG_CONSTEXPR bool empty() const SPDLOG_NOEXCEPT {