mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 02:37:36 +02:00
Cleanup
This commit is contained in:
@ -761,28 +761,22 @@ using is_integer =
|
|||||||
# define FMT_USE_LONG_DOUBLE 1
|
# define FMT_USE_LONG_DOUBLE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FMT_USE_FLOAT128
|
#if defined(FMT_USE_FLOAT128)
|
||||||
# ifdef __clang__
|
// Use the provided definition.
|
||||||
// Clang emulates GCC, so it has to appear early.
|
#elif FMT_CLANG_VERSION && FMT_HAS_INCLUDE(<quadmath.h>)
|
||||||
# if FMT_HAS_INCLUDE(<quadmath.h>)
|
# define FMT_USE_FLOAT128 1
|
||||||
# define FMT_USE_FLOAT128 1
|
#elif FMT_GCC_VERSION && defined(_GLIBCXX_USE_FLOAT128) && \
|
||||||
# endif
|
!defined(__STRICT_ANSI__)
|
||||||
# elif defined(__GNUC__)
|
# define FMT_USE_FLOAT128 1
|
||||||
// GNU C++:
|
#else
|
||||||
# if defined(_GLIBCXX_USE_FLOAT128) && !defined(__STRICT_ANSI__)
|
# define FMT_USE_FLOAT128 0
|
||||||
# define FMT_USE_FLOAT128 1
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# ifndef FMT_USE_FLOAT128
|
|
||||||
# define FMT_USE_FLOAT128 0
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FMT_USE_FLOAT128
|
#if FMT_USE_FLOAT128
|
||||||
using float128 = __float128;
|
using float128 = __float128;
|
||||||
#else
|
#else
|
||||||
using float128 = void;
|
using float128 = void;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <typename T> using is_float128 = std::is_same<T, float128>;
|
template <typename T> using is_float128 = std::is_same<T, float128>;
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -1793,15 +1793,14 @@ struct deadlockable {
|
|||||||
|
|
||||||
FMT_BEGIN_NAMESPACE
|
FMT_BEGIN_NAMESPACE
|
||||||
template <> struct formatter<deadlockable> {
|
template <> struct formatter<deadlockable> {
|
||||||
FMT_CONSTEXPR auto parse(fmt::format_parse_context& ctx)
|
FMT_CONSTEXPR auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) {
|
||||||
-> decltype(ctx.begin()) {
|
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto format(const deadlockable& d, fmt::format_context& ctx) const
|
auto format(const deadlockable& d, format_context& ctx) const
|
||||||
-> decltype(ctx.out()) {
|
-> decltype(ctx.out()) {
|
||||||
std::lock_guard<std::mutex> lock(d.mutex);
|
std::lock_guard<std::mutex> lock(d.mutex);
|
||||||
return fmt::format_to(ctx.out(), "{}", d.value);
|
return format_to(ctx.out(), "{}", d.value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
FMT_END_NAMESPACE
|
FMT_END_NAMESPACE
|
||||||
|
Reference in New Issue
Block a user