forked from fmtlib/fmt
Don't use _ecvt (#233)
This commit is contained in:
9
format.h
9
format.h
@ -228,7 +228,6 @@ typedef std::numeric_limits<fmt::internal::DummyInt> FPUtil;
|
|||||||
// if the latter are not available.
|
// if the latter are not available.
|
||||||
inline DummyInt signbit(...) { return DummyInt(); }
|
inline DummyInt signbit(...) { return DummyInt(); }
|
||||||
inline DummyInt _ecvt_s(...) { return DummyInt(); }
|
inline DummyInt _ecvt_s(...) { return DummyInt(); }
|
||||||
inline DummyInt _ecvt(...) { return DummyInt(); }
|
|
||||||
inline DummyInt isinf(...) { return DummyInt(); }
|
inline DummyInt isinf(...) { return DummyInt(); }
|
||||||
inline DummyInt _finite(...) { return DummyInt(); }
|
inline DummyInt _finite(...) { return DummyInt(); }
|
||||||
inline DummyInt isnan(...) { return DummyInt(); }
|
inline DummyInt isnan(...) { return DummyInt(); }
|
||||||
@ -273,12 +272,8 @@ class numeric_limits<fmt::internal::DummyInt> :
|
|||||||
if (x < 0) return true;
|
if (x < 0) return true;
|
||||||
if (!isnotanumber(x)) return false;
|
if (!isnotanumber(x)) return false;
|
||||||
int dec = 0, sign = 0;
|
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.
|
||||||
char buffer[2]; // The buffer size must be >= 2 or _ecvt_s will fail.
|
_ecvt_s(buffer, sizeof(buffer), x, 0, &dec, &sign);
|
||||||
_ecvt_s(buffer, sizeof(buffer), x, 0, &dec, &sign);
|
|
||||||
return sign != 0;
|
|
||||||
}
|
|
||||||
_ecvt(x, 0, &dec, &sign);
|
|
||||||
return sign != 0;
|
return sign != 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user