mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-28 06:36:02 +00:00
Don't use _ecvt (#233)
This commit is contained in:
parent
9a08fb52bf
commit
0519737b95
5
format.h
5
format.h
@ -228,7 +228,6 @@ typedef std::numeric_limits<fmt::internal::DummyInt> FPUtil;
|
||||
// if the latter are not available.
|
||||
inline DummyInt signbit(...) { return DummyInt(); }
|
||||
inline DummyInt _ecvt_s(...) { return DummyInt(); }
|
||||
inline DummyInt _ecvt(...) { return DummyInt(); }
|
||||
inline DummyInt isinf(...) { return DummyInt(); }
|
||||
inline DummyInt _finite(...) { return DummyInt(); }
|
||||
inline DummyInt isnan(...) { return DummyInt(); }
|
||||
@ -273,14 +272,10 @@ class numeric_limits<fmt::internal::DummyInt> :
|
||||
if (x < 0) return true;
|
||||
if (!isnotanumber(x)) return false;
|
||||
int dec = 0, sign = 0;
|
||||
if (sizeof(_ecvt_s(0, 0, x, 0, 0, 0)) == sizeof(int)) {
|
||||
char buffer[2]; // The buffer size must be >= 2 or _ecvt_s will fail.
|
||||
_ecvt_s(buffer, sizeof(buffer), x, 0, &dec, &sign);
|
||||
return sign != 0;
|
||||
}
|
||||
_ecvt(x, 0, &dec, &sign);
|
||||
return sign != 0;
|
||||
}
|
||||
};
|
||||
} // namespace std
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user