Modify the condition of SPDLOG_CONSTEXPR_FUNC to match that of fmt

fix the issue where constexpr function in spdlog may call non-constexpr function in the bundled fmt because FMT_USE_CONSTEXPR is not defined.
pull/2901/head
Shujian Qian 2 years ago committed by Keith Kraus
parent 508d20f0fa
commit b0ad64743d
No known key found for this signature in database
GPG Key ID: ACE9FE4160B1CD9C

@ -65,15 +65,21 @@
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define SPDLOG_NOEXCEPT _NOEXCEPT
#define SPDLOG_CONSTEXPR
#define SPDLOG_CONSTEXPR_FUNC inline
#else
#define SPDLOG_NOEXCEPT noexcept
#define SPDLOG_CONSTEXPR constexpr
#if __cplusplus >= 201402L
#define SPDLOG_CONSTEXPR_FUNC constexpr
#else
#define SPDLOG_CONSTEXPR_FUNC inline
#endif
#endif
#ifndef __has_feature
# define __has_feature(x) 0
#endif
#if (__has_feature(cxx_relaxed_constexpr) || (defined(_MSC_VER) && (_MSC_VER >= 1912)) || \
(defined(__GNUC__) && __GNUC__ >= 6 && defined(__cplusplus) && __cplusplus >= 201402L)) && \
!defined(__ICL) && !defined(__INTEL_COMPILER) && !defined(__NVCC__)
#define SPDLOG_CONSTEXPR_FUNC constexpr
#else
#define SPDLOG_CONSTEXPR_FUNC inline
#endif
#if defined(__GNUC__) || defined(__clang__)

Loading…
Cancel
Save