Log, client/Response, io/BufferedOutputStream: drop support for libfmt < 7
Remove some compatibility code.
This commit is contained in:
parent
b09a776a26
commit
7f3868727b
1
NEWS
1
NEWS
|
@ -24,6 +24,7 @@ ver 0.24 (not yet released)
|
||||||
- GCC 10 or clang 11 (or newer) recommended
|
- GCC 10 or clang 11 (or newer) recommended
|
||||||
* static partition configuration
|
* static partition configuration
|
||||||
* remove Haiku support
|
* remove Haiku support
|
||||||
|
* require libfmt 7 or later
|
||||||
|
|
||||||
ver 0.23.11 (2022/11/28)
|
ver 0.23.11 (2022/11/28)
|
||||||
* database
|
* database
|
||||||
|
|
|
@ -248,7 +248,7 @@ if boost_dep.version() == '1.67'
|
||||||
warning('Your Boost version 1.67 is known to be buggy, and the MPD build will fail. Please upgrade to Boost 1.68 or later.')
|
warning('Your Boost version 1.67 is known to be buggy, and the MPD build will fail. Please upgrade to Boost 1.68 or later.')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
fmt_dep = dependency('fmt', fallback: ['fmt', 'fmt_dep'])
|
fmt_dep = dependency('fmt', version: '>= 7', fallback: ['fmt', 'fmt_dep'])
|
||||||
|
|
||||||
if compiler.get_id() == 'clang' and compiler.version().version_compare('<15')
|
if compiler.get_id() == 'clang' and compiler.version().version_compare('<15')
|
||||||
fmt_dep = declare_dependency(
|
fmt_dep = declare_dependency(
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "LogLevel.hxx"
|
#include "LogLevel.hxx"
|
||||||
|
|
||||||
#include <fmt/core.h>
|
#include <fmt/core.h>
|
||||||
#if FMT_VERSION < 70000 || FMT_VERSION >= 80000
|
#if FMT_VERSION >= 80000
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -48,14 +48,10 @@ LogFmt(LogLevel level, const Domain &domain,
|
||||||
#if FMT_VERSION >= 90000
|
#if FMT_VERSION >= 90000
|
||||||
return LogVFmt(level, domain, format_str,
|
return LogVFmt(level, domain, format_str,
|
||||||
fmt::make_format_args(args...));
|
fmt::make_format_args(args...));
|
||||||
#elif FMT_VERSION >= 70000
|
#else
|
||||||
return LogVFmt(level, domain, fmt::to_string_view(format_str),
|
return LogVFmt(level, domain, fmt::to_string_view(format_str),
|
||||||
fmt::make_args_checked<Args...>(format_str,
|
fmt::make_args_checked<Args...>(format_str,
|
||||||
args...));
|
args...));
|
||||||
#else
|
|
||||||
/* expensive fallback for older libfmt versions */
|
|
||||||
const auto result = fmt::format(format_str, args...);
|
|
||||||
return Log(level, domain, result);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "protocol/Ack.hxx"
|
#include "protocol/Ack.hxx"
|
||||||
|
|
||||||
#include <fmt/core.h>
|
#include <fmt/core.h>
|
||||||
#if FMT_VERSION < 70000 || FMT_VERSION >= 80000
|
#if FMT_VERSION >= 80000
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -85,14 +85,10 @@ public:
|
||||||
#if FMT_VERSION >= 90000
|
#if FMT_VERSION >= 90000
|
||||||
return VFmt(format_str,
|
return VFmt(format_str,
|
||||||
fmt::make_format_args(args...));
|
fmt::make_format_args(args...));
|
||||||
#elif FMT_VERSION >= 70000
|
#else
|
||||||
return VFmt(fmt::to_string_view(format_str),
|
return VFmt(fmt::to_string_view(format_str),
|
||||||
fmt::make_args_checked<Args...>(format_str,
|
fmt::make_args_checked<Args...>(format_str,
|
||||||
args...));
|
args...));
|
||||||
#else
|
|
||||||
/* expensive fallback for older libfmt versions */
|
|
||||||
const auto result = fmt::format(format_str, args...);
|
|
||||||
return Write(result.data(), result.size());
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,14 +111,10 @@ public:
|
||||||
#if FMT_VERSION >= 90000
|
#if FMT_VERSION >= 90000
|
||||||
return VFmtError(code, format_str,
|
return VFmtError(code, format_str,
|
||||||
fmt::make_format_args(args...));
|
fmt::make_format_args(args...));
|
||||||
#elif FMT_VERSION >= 70000
|
#else
|
||||||
return VFmtError(code, fmt::to_string_view(format_str),
|
return VFmtError(code, fmt::to_string_view(format_str),
|
||||||
fmt::make_args_checked<Args...>(format_str,
|
fmt::make_args_checked<Args...>(format_str,
|
||||||
args...));
|
args...));
|
||||||
#else
|
|
||||||
/* expensive fallback for older libfmt versions */
|
|
||||||
const auto result = fmt::format(format_str, args...);
|
|
||||||
return Error(code, result.c_str());
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include "util/DynamicFifoBuffer.hxx"
|
#include "util/DynamicFifoBuffer.hxx"
|
||||||
|
|
||||||
#include <fmt/core.h>
|
#include <fmt/core.h>
|
||||||
#if FMT_VERSION < 70000 || FMT_VERSION >= 80000
|
#if FMT_VERSION >= 80000
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -104,14 +104,10 @@ public:
|
||||||
#if FMT_VERSION >= 90000
|
#if FMT_VERSION >= 90000
|
||||||
VFmt(format_str,
|
VFmt(format_str,
|
||||||
fmt::make_format_args(args...));
|
fmt::make_format_args(args...));
|
||||||
#elif FMT_VERSION >= 70000
|
#else
|
||||||
VFmt(fmt::to_string_view(format_str),
|
VFmt(fmt::to_string_view(format_str),
|
||||||
fmt::make_args_checked<Args...>(format_str,
|
fmt::make_args_checked<Args...>(format_str,
|
||||||
args...));
|
args...));
|
||||||
#else
|
|
||||||
/* expensive fallback for older libfmt versions */
|
|
||||||
const auto result = fmt::format(format_str, args...);
|
|
||||||
Write(result.data(), result.size());
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue