Fix MSVC build, take 2.
This commit is contained in:
parent
73fda2a8b1
commit
302b8f4406
@ -118,6 +118,8 @@ void ReportError(FormatFunc func,
|
||||
}
|
||||
} // namespace
|
||||
|
||||
int fmt::internal::SignBitNoInline(double value) { return SignBit(value); }
|
||||
|
||||
template <typename T>
|
||||
int fmt::internal::CharTraits<char>::FormatFloat(
|
||||
char *buffer, std::size_t size, const char *format,
|
||||
|
2
format.h
2
format.h
@ -399,6 +399,8 @@ inline bool IsNegative(T value) {
|
||||
return SignChecker<std::numeric_limits<T>::is_signed>::IsNegative(value);
|
||||
}
|
||||
|
||||
int SignBitNoInline(double value);
|
||||
|
||||
template <typename T>
|
||||
struct IntTraits {
|
||||
// Smallest of uint32_t and uint64_t that is large enough to represent
|
||||
|
@ -1235,8 +1235,7 @@ TEST(FormatterTest, FormatNaN) {
|
||||
double nan = std::numeric_limits<double>::quiet_NaN();
|
||||
EXPECT_EQ("nan", str(Format("{}") << nan));
|
||||
EXPECT_EQ("+nan", str(Format("{:+}") << nan));
|
||||
using namespace std;
|
||||
if (signbit(-nan))
|
||||
if (fmt::internal::SignBitNoInline(-nan))
|
||||
EXPECT_EQ("-nan", str(Format("{}") << -nan));
|
||||
else
|
||||
fmt::Print("Warning: compiler doesn't handle negative NaN correctly");
|
||||
|
Loading…
Reference in New Issue
Block a user