From 0519737b95532efb9a110e6543ca0fc930cbfb05 Mon Sep 17 00:00:00 2001 From: vitaut Date: Wed, 25 Nov 2015 07:11:28 -0800 Subject: [PATCH] Don't use _ecvt (#233) --- format.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/format.h b/format.h index 8316d918..c3c7cf46 100644 --- a/format.h +++ b/format.h @@ -228,7 +228,6 @@ typedef std::numeric_limits 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 : 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; } };