mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 10:01:33 +08:00
Fix build issues under C++11
This commit is contained in:
parent
6ff1b83038
commit
89c4b1aabe
@ -55,9 +55,15 @@
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1900)
|
||||
# define SPDLOG_NOEXCEPT _NOEXCEPT
|
||||
# define SPDLOG_CONSTEXPR
|
||||
# define SPDLOG_CONSTEXPR_FUNC
|
||||
#else
|
||||
# define SPDLOG_NOEXCEPT noexcept
|
||||
# define SPDLOG_CONSTEXPR constexpr
|
||||
# if __cplusplus >= 201402L
|
||||
# define SPDLOG_CONSTEXPR_FUNC constexpr
|
||||
# else
|
||||
# define SPDLOG_CONSTEXPR_FUNC
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
|
@ -34,7 +34,7 @@ template<typename T>
|
||||
inline void append_int(T n, memory_buf_t &dest)
|
||||
{
|
||||
// Buffer should be large enough to hold all digits (digits10 + 1) and a sign
|
||||
SPDLOG_CONSTEXPR auto BUF_SIZE = std::numeric_limits<T>::digits10 + 2;
|
||||
SPDLOG_CONSTEXPR const auto BUF_SIZE = std::numeric_limits<T>::digits10 + 2;
|
||||
char buf[BUF_SIZE];
|
||||
|
||||
auto [ptr, ec] = std::to_chars(buf, buf + BUF_SIZE, n, 10);
|
||||
|
@ -96,7 +96,7 @@ struct formatter<spdlog::details::dump_info<T>, char>
|
||||
|
||||
// parse the format string flags
|
||||
template<typename ParseContext>
|
||||
SPDLOG_CONSTEXPR auto parse(ParseContext &ctx) -> decltype(ctx.begin())
|
||||
SPDLOG_CONSTEXPR_FUNC auto parse(ParseContext &ctx) -> decltype(ctx.begin())
|
||||
{
|
||||
auto it = ctx.begin();
|
||||
while (it != ctx.end() && *it != '}')
|
||||
|
Loading…
Reference in New Issue
Block a user