mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 15:21:54 +00:00
Workaround a bug in formatting long double in MinGW, take 3
This commit is contained in:
parent
3e379829a0
commit
85b985e9f2
@ -84,7 +84,7 @@ void std_format(const T &value, std::basic_string<Char> &result) {
|
||||
// Workaround a bug in formatting long double in MinGW.
|
||||
void std_format(long double value, std::string &result) {
|
||||
char buffer[100];
|
||||
snprintf(buffer, sizeof(buffer), "%Lg", value);
|
||||
safe_sprintf(buffer, "%Lg", value);
|
||||
result = buffer;
|
||||
}
|
||||
#endif
|
||||
@ -96,7 +96,7 @@ template <typename Char, typename T>
|
||||
std::basic_string<Char> actual =
|
||||
(fmt::BasicMemoryWriter<Char>() << value).str();
|
||||
std::basic_string<Char> expected;
|
||||
std_format<Char>(value, expected);
|
||||
std_format(value, expected);
|
||||
if (expected == actual)
|
||||
return ::testing::AssertionSuccess();
|
||||
return ::testing::AssertionFailure()
|
||||
|
Loading…
Reference in New Issue
Block a user