update to fmtlib-8.1.1
This commit is contained in:
@ -17,7 +17,7 @@
|
||||
#include <type_traits>
|
||||
|
||||
// The fmt library version in the form major * 10000 + minor * 100 + patch.
|
||||
#define FMT_VERSION 80100
|
||||
#define FMT_VERSION 80101
|
||||
|
||||
#if defined(__clang__) && !defined(__ibmxl__)
|
||||
# define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__)
|
||||
@ -219,6 +219,20 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef FMT_DEPRECATED
|
||||
# if FMT_HAS_CPP14_ATTRIBUTE(deprecated) || FMT_MSC_VER >= 1900
|
||||
# define FMT_DEPRECATED [[deprecated]]
|
||||
# else
|
||||
# if (defined(__GNUC__) && !defined(__LCC__)) || defined(__clang__)
|
||||
# define FMT_DEPRECATED __attribute__((deprecated))
|
||||
# elif FMT_MSC_VER
|
||||
# define FMT_DEPRECATED __declspec(deprecated)
|
||||
# else
|
||||
# define FMT_DEPRECATED /* deprecated */
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// LAMMPS customization
|
||||
// use 'v8_lmp' namespace instead of 'v8' so that our
|
||||
// bundled copy does not collide with linking other code
|
||||
@ -571,6 +585,7 @@ constexpr auto to_string_view(const S& s)
|
||||
}
|
||||
|
||||
FMT_BEGIN_DETAIL_NAMESPACE
|
||||
|
||||
void to_string_view(...);
|
||||
using fmt::to_string_view;
|
||||
|
||||
@ -606,7 +621,7 @@ struct error_handler {
|
||||
constexpr error_handler(const error_handler&) = default;
|
||||
|
||||
// This function is intentionally not constexpr to give a compile-time error.
|
||||
void on_error(const char* message) { throw_format_error(message); }
|
||||
FMT_NORETURN FMT_API void on_error(const char* message);
|
||||
};
|
||||
FMT_END_DETAIL_NAMESPACE
|
||||
|
||||
@ -1378,21 +1393,20 @@ template <typename Context> struct arg_mapper {
|
||||
using cstring_result = conditional_t<std::is_same<char_type, char>::value,
|
||||
const char*, unformattable_pointer>;
|
||||
|
||||
// DEPRECATED!
|
||||
FMT_CONSTEXPR FMT_INLINE auto map(const signed char* val) -> cstring_result {
|
||||
return map(reinterpret_cast<const char*>(val));
|
||||
}
|
||||
// DEPRECATED!
|
||||
FMT_CONSTEXPR FMT_INLINE auto map(const unsigned char* val)
|
||||
FMT_DEPRECATED FMT_CONSTEXPR FMT_INLINE auto map(const signed char* val)
|
||||
-> cstring_result {
|
||||
return map(reinterpret_cast<const char*>(val));
|
||||
}
|
||||
// DEPRECATED!
|
||||
FMT_CONSTEXPR FMT_INLINE auto map(signed char* val) -> cstring_result {
|
||||
FMT_DEPRECATED FMT_CONSTEXPR FMT_INLINE auto map(const unsigned char* val)
|
||||
-> cstring_result {
|
||||
return map(reinterpret_cast<const char*>(val));
|
||||
}
|
||||
// DEPRECATED!
|
||||
FMT_CONSTEXPR FMT_INLINE auto map(unsigned char* val) -> cstring_result {
|
||||
FMT_DEPRECATED FMT_CONSTEXPR FMT_INLINE auto map(signed char* val)
|
||||
-> cstring_result {
|
||||
return map(reinterpret_cast<const char*>(val));
|
||||
}
|
||||
FMT_DEPRECATED FMT_CONSTEXPR FMT_INLINE auto map(unsigned char* val)
|
||||
-> cstring_result {
|
||||
return map(reinterpret_cast<const char*>(val));
|
||||
}
|
||||
|
||||
|
||||
@ -2595,6 +2595,12 @@ FMT_FUNC void report_system_error(int error_code,
|
||||
report_error(format_system_error, error_code, message);
|
||||
}
|
||||
|
||||
// DEPRECATED!
|
||||
// This function is defined here and not inline for ABI compatiblity.
|
||||
FMT_FUNC void detail::error_handler::on_error(const char* message) {
|
||||
throw_format_error(message);
|
||||
}
|
||||
|
||||
FMT_FUNC std::string vformat(string_view fmt, format_args args) {
|
||||
// Don't optimize the "{}" case to keep the binary size small and because it
|
||||
// can be better optimized in fmt::format anyway.
|
||||
|
||||
@ -110,20 +110,6 @@ FMT_END_NAMESPACE
|
||||
# define FMT_CATCH(x) if (false)
|
||||
#endif
|
||||
|
||||
#ifndef FMT_DEPRECATED
|
||||
# if FMT_HAS_CPP14_ATTRIBUTE(deprecated) || FMT_MSC_VER >= 1900
|
||||
# define FMT_DEPRECATED [[deprecated]]
|
||||
# else
|
||||
# if (defined(__GNUC__) && !defined(__LCC__)) || defined(__clang__)
|
||||
# define FMT_DEPRECATED __attribute__((deprecated))
|
||||
# elif FMT_MSC_VER
|
||||
# define FMT_DEPRECATED __declspec(deprecated)
|
||||
# else
|
||||
# define FMT_DEPRECATED /* deprecated */
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef FMT_MAYBE_UNUSED
|
||||
# if FMT_HAS_CPP17_ATTRIBUTE(maybe_unused)
|
||||
# define FMT_MAYBE_UNUSED [[maybe_unused]]
|
||||
@ -310,10 +296,18 @@ FMT_CONSTEXPR20 auto bit_cast(const From& from) -> To {
|
||||
}
|
||||
|
||||
inline auto is_big_endian() -> bool {
|
||||
#ifdef _WIN32
|
||||
return false;
|
||||
#elif defined(__BIG_ENDIAN__)
|
||||
return true;
|
||||
#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__)
|
||||
return __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__;
|
||||
#else
|
||||
struct bytes {
|
||||
char data[sizeof(int)];
|
||||
};
|
||||
return bit_cast<bytes>(1).data[0] == 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
// A fallback implementation of uintptr_t for systems that lack it.
|
||||
@ -323,7 +317,7 @@ struct fallback_uintptr {
|
||||
fallback_uintptr() = default;
|
||||
explicit fallback_uintptr(const void* p) {
|
||||
*this = bit_cast<fallback_uintptr>(p);
|
||||
if (is_big_endian()) {
|
||||
if (const_check(is_big_endian())) {
|
||||
for (size_t i = 0, j = sizeof(void*) - 1; i < j; ++i, --j)
|
||||
std::swap(value[i], value[j]);
|
||||
}
|
||||
@ -526,7 +520,7 @@ FMT_CONSTEXPR inline auto utf8_decode(const char* s, uint32_t* c, int* e)
|
||||
return next;
|
||||
}
|
||||
|
||||
enum { invalid_code_point = ~uint32_t() };
|
||||
constexpr uint32_t invalid_code_point = ~uint32_t();
|
||||
|
||||
// Invokes f(cp, sv) for every code point cp in s with sv being the string view
|
||||
// corresponding to the code point. cp is invalid_code_point on error.
|
||||
@ -3044,14 +3038,8 @@ constexpr auto operator"" _a(const char* s, size_t) -> detail::udl_arg<char> {
|
||||
}
|
||||
# endif
|
||||
|
||||
/**
|
||||
DEPRECATED! User-defined literal equivalent of fmt::format.
|
||||
|
||||
**Example**::
|
||||
|
||||
using namespace fmt::literals;
|
||||
std::string message = "The answer is {}"_format(42);
|
||||
*/
|
||||
// DEPRECATED!
|
||||
// User-defined literal equivalent of fmt::format.
|
||||
FMT_DEPRECATED constexpr auto operator"" _format(const char* s, size_t n)
|
||||
-> detail::udl_formatter<char> {
|
||||
return {{s, n}};
|
||||
|
||||
Reference in New Issue
Block a user