mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-29 13:21:05 +00:00
Fix Clang build.
This commit is contained in:
parent
481c313df5
commit
24d6baa60f
13
format.cc
13
format.cc
@ -69,9 +69,14 @@ namespace {
|
|||||||
using std::signbit;
|
using std::signbit;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef isinf
|
// Portable version of isinf.
|
||||||
using std::isinf;
|
inline int fmt_isinf(double x) {
|
||||||
|
#ifdef isinf
|
||||||
|
return isinf(x);
|
||||||
|
#else
|
||||||
|
return std::isinf(x);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#define FMT_SNPRINTF snprintf
|
#define FMT_SNPRINTF snprintf
|
||||||
|
|
||||||
@ -86,7 +91,7 @@ inline int signbit(double value) {
|
|||||||
return sign;
|
return sign;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int isinf(double x) { return !_finite(x); }
|
inline int fmt_isinf(double x) { return !_finite(x); }
|
||||||
|
|
||||||
inline int safe_printf(char *buffer, size_t size, const char *format, ...) {
|
inline int safe_printf(char *buffer, size_t size, const char *format, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
@ -546,7 +551,7 @@ void fmt::BasicWriter<Char>::write_double(T value, const FormatSpec &spec) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isinf(static_cast<double>(value))) {
|
if (fmt_isinf(static_cast<double>(value))) {
|
||||||
// Format infinity ourselves because sprintf's output is not consistent
|
// Format infinity ourselves because sprintf's output is not consistent
|
||||||
// across platforms.
|
// across platforms.
|
||||||
std::size_t size = 4;
|
std::size_t size = 4;
|
||||||
|
Loading…
Reference in New Issue
Block a user