Skip to content

Commit a731c73

Browse files
committed
Make FMT_USE_FULL_CACHE_DRAGONBOX depend on __OPTIMIZE_SIZE__ by default
Thanks to Matthias Kretz for the idea.
1 parent 3391f9e commit a731c73

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

include/fmt/format-inl.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030
# define FMT_FUNC
3131
#endif
3232

33+
#if defined(FMT_USE_FULL_CACHE_DRAGONBOX)
34+
// Use the provided definition.
35+
#elif defined(__OPTIMIZE_SIZE__)
36+
# define FMT_USE_FULL_CACHE_DRAGONBOX 0
37+
#else
38+
# define FMT_USE_FULL_CACHE_DRAGONBOX 1
39+
#endif
40+
3341
FMT_BEGIN_NAMESPACE
3442

3543
#ifndef FMT_CUSTOM_ASSERT_FAIL

include/fmt/format.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -736,10 +736,6 @@ using fast_float_t = conditional_t<sizeof(T) == sizeof(double), double, float>;
736736
template <typename T>
737737
using is_double_double = bool_constant<std::numeric_limits<T>::digits == 106>;
738738

739-
#ifndef FMT_USE_FULL_CACHE_DRAGONBOX
740-
# define FMT_USE_FULL_CACHE_DRAGONBOX 0
741-
#endif
742-
743739
// An allocator that uses malloc/free to allow removing dependency on the C++
744740
// standard libary runtime. std::decay is used for back_inserter to be found by
745741
// ADL when applied to memory_buffer.

0 commit comments

Comments
 (0)