fix interal compiler error when building with mingw
This commit is contained in:
parent
25d6916b3a
commit
9fc4161f5e
@ -1147,7 +1147,8 @@ int snprintf_float(T value, int precision, float_specs specs,
|
|||||||
"fuzz mode - avoid large allocation inside snprintf");
|
"fuzz mode - avoid large allocation inside snprintf");
|
||||||
#endif
|
#endif
|
||||||
// Suppress the warning about a nonliteral format string.
|
// Suppress the warning about a nonliteral format string.
|
||||||
auto snprintf_ptr = FMT_SNPRINTF;
|
// Cannot use auto becase of a bug in MinGW (#1532).
|
||||||
|
int (*snprintf_ptr)(char*, size_t, const char*, ...) = FMT_SNPRINTF;
|
||||||
int result = precision >= 0
|
int result = precision >= 0
|
||||||
? snprintf_ptr(begin, capacity, format, precision, value)
|
? snprintf_ptr(begin, capacity, format, precision, value)
|
||||||
: snprintf_ptr(begin, capacity, format, value);
|
: snprintf_ptr(begin, capacity, format, value);
|
||||||
|
@ -19,7 +19,7 @@ int format_float(char* buf, std::size_t size, const char* format, int precision,
|
|||||||
"fuzz mode - avoid large allocation inside snprintf");
|
"fuzz mode - avoid large allocation inside snprintf");
|
||||||
#endif
|
#endif
|
||||||
// Suppress the warning about nonliteral format string.
|
// Suppress the warning about nonliteral format string.
|
||||||
auto snprintf_ptr = FMT_SNPRINTF;
|
int (*snprintf_ptr)(char*, size_t, const char*, ...) = FMT_SNPRINTF;
|
||||||
return precision < 0 ? snprintf_ptr(buf, size, format, value)
|
return precision < 0 ? snprintf_ptr(buf, size, format, value)
|
||||||
: snprintf_ptr(buf, size, format, precision, value);
|
: snprintf_ptr(buf, size, format, precision, value);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user