Skip to content

Commit 5af8865

Browse files
committed
Cleanup
1 parent 45b772f commit 5af8865

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

include/fmt/format.h

+10-16
Original file line numberDiff line numberDiff line change
@@ -761,28 +761,22 @@ using is_integer =
761761
# define FMT_USE_LONG_DOUBLE 1
762762
#endif
763763

764-
#ifndef FMT_USE_FLOAT128
765-
# ifdef __clang__
766-
// Clang emulates GCC, so it has to appear early.
767-
# if FMT_HAS_INCLUDE(<quadmath.h>)
768-
# define FMT_USE_FLOAT128 1
769-
# endif
770-
# elif defined(__GNUC__)
771-
// GNU C++:
772-
# if defined(_GLIBCXX_USE_FLOAT128) && !defined(__STRICT_ANSI__)
773-
# define FMT_USE_FLOAT128 1
774-
# endif
775-
# endif
776-
# ifndef FMT_USE_FLOAT128
777-
# define FMT_USE_FLOAT128 0
778-
# endif
764+
#if defined(FMT_USE_FLOAT128)
765+
// Use the provided definition.
766+
#elif FMT_CLANG_VERSION && FMT_HAS_INCLUDE(<quadmath.h>)
767+
# define FMT_USE_FLOAT128 1
768+
#elif FMT_GCC_VERSION && defined(_GLIBCXX_USE_FLOAT128) && \
769+
!defined(__STRICT_ANSI__)
770+
# define FMT_USE_FLOAT128 1
771+
#else
772+
# define FMT_USE_FLOAT128 0
779773
#endif
780-
781774
#if FMT_USE_FLOAT128
782775
using float128 = __float128;
783776
#else
784777
using float128 = void;
785778
#endif
779+
786780
template <typename T> using is_float128 = std::is_same<T, float128>;
787781

788782
template <typename T>

test/format-test.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -1793,15 +1793,14 @@ struct deadlockable {
17931793

17941794
FMT_BEGIN_NAMESPACE
17951795
template <> struct formatter<deadlockable> {
1796-
FMT_CONSTEXPR auto parse(fmt::format_parse_context& ctx)
1797-
-> decltype(ctx.begin()) {
1796+
FMT_CONSTEXPR auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) {
17981797
return ctx.begin();
17991798
}
18001799

1801-
auto format(const deadlockable& d, fmt::format_context& ctx) const
1800+
auto format(const deadlockable& d, format_context& ctx) const
18021801
-> decltype(ctx.out()) {
18031802
std::lock_guard<std::mutex> lock(d.mutex);
1804-
return fmt::format_to(ctx.out(), "{}", d.value);
1803+
return format_to(ctx.out(), "{}", d.value);
18051804
}
18061805
};
18071806
FMT_END_NAMESPACE

0 commit comments

Comments
 (0)