Allow disabling floating point support (#1590)
* Allow disabling floating point support Add FMT_USE_FLOAT, FMT_USE_DOUBLE and FMT_USE_LONG_DOUBLE to allow a user of the library to configure the float types they want to allow. This is specially useful in embedded environements where code size is important. * Avoid conditional macros to disable float support * Add is_supported_floating_point constexpr function * Fix empty-body warning
This commit is contained in:
@@ -316,6 +316,18 @@ struct int128_t {};
|
||||
struct uint128_t {};
|
||||
#endif
|
||||
|
||||
#ifndef FMT_USE_FLOAT
|
||||
# define FMT_USE_FLOAT 1
|
||||
#endif
|
||||
|
||||
#ifndef FMT_USE_DOUBLE
|
||||
# define FMT_USE_DOUBLE 1
|
||||
#endif
|
||||
|
||||
#ifndef FMT_USE_LONG_DOUBLE
|
||||
# define FMT_USE_LONG_DOUBLE 1
|
||||
#endif
|
||||
|
||||
// Casts a nonnegative integer to unsigned.
|
||||
template <typename Int>
|
||||
FMT_CONSTEXPR typename std::make_unsigned<Int>::type to_unsigned(Int value) {
|
||||
|
||||
Reference in New Issue
Block a user