Don't use _ecvt (#233)

This commit is contained in:
vitaut 2015-11-25 07:11:28 -08:00
parent 9a08fb52bf
commit 0519737b95

View File

@ -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,12 +272,8 @@ 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);
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;
}
};