diff --git a/std/conv.d b/std/conv.d index 208bafd67a2..79fc964902e 100644 --- a/std/conv.d +++ b/std/conv.d @@ -2957,12 +2957,19 @@ unittest ld = parse!real(s2); assert(s2.empty); x = *cast(longdouble *)&ld; - version (CRuntime_Microsoft) - ld1 = 0x1.FFFFFFFFFFFFFFFEp-16382L; // strtold currently mapped to strtod - else version (Android) - ld1 = 0x1.FFFFFFFFFFFFFFFEp-16382L; // strtold currently mapped to strtod + + static if(real.mant_dig == 64) + { + version (CRuntime_Microsoft) + ld1 = 0x1.FFFFFFFFFFFFFFFEp-16382L; // strtold currently mapped to strtod + else version (Android) + ld1 = 0x1.FFFFFFFFFFFFFFFEp-16382L; // strtold currently mapped to strtod + else + ld1 = strtold(s.ptr, null); + } else ld1 = strtold(s.ptr, null); + x1 = *cast(longdouble *)&ld1; assert(x1 == x && ld1 == ld); diff --git a/std/format.d b/std/format.d index 20581e98923..72c6dab8f7b 100644 --- a/std/format.d +++ b/std/format.d @@ -3686,7 +3686,8 @@ unittest } else version (CRuntime_Microsoft) { - assert(stream.data == "1.67 -0X1.47AE14P+0 nan", + assert(stream.data == "1.67 -0X1.47AE14P+0 nan" + || stream.data == "1.67 -0X1.47AE147AE147BP+0 nan", // MSVCRT 14+ (VS 2015) stream.data); } else version (Android) @@ -3722,7 +3723,8 @@ unittest formattedWrite(stream, "%a %A", 1.32, 6.78f); //formattedWrite(stream, "%x %X", 1.32); version (CRuntime_Microsoft) - assert(stream.data == "0x1.51eb85p+0 0X1.B1EB86P+2"); + assert(stream.data == "0x1.51eb85p+0 0X1.B1EB86P+2" + || stream.data == "0x1.51eb851eb851fp+0 0X1.B1EB860000000P+2"); // MSVCRT 14+ (VS 2015) else version (Android) { // bionic doesn't support hex formatting of floating point numbers, @@ -6204,7 +6206,8 @@ unittest version (MinGW) assert(s == "1.67 -0XA.3D70A3D70A3D8P-3 nan", s); else version (CRuntime_Microsoft) - assert(s == "1.67 -0X1.47AE14P+0 nan", s); + assert(s == "1.67 -0X1.47AE14P+0 nan" + || s == "1.67 -0X1.47AE147AE147BP+0 nan", s); // MSVCRT 14+ (VS 2015) else version (Android) { // bionic doesn't support hex formatting of floating point numbers diff --git a/std/outbuffer.d b/std/outbuffer.d index 20b76c5e08a..ee4a1da38f0 100644 --- a/std/outbuffer.d +++ b/std/outbuffer.d @@ -269,7 +269,7 @@ class OutBuffer { version(Windows) { - count = _vsnprintf(p,psize,f,args); + count = vsnprintf(p,psize,f,args); if (count != -1) break; psize *= 2; diff --git a/std/stream.d b/std/stream.d index c52c27d564a..d1e5a2ccb43 100644 --- a/std/stream.d +++ b/std/stream.d @@ -1181,7 +1181,7 @@ class Stream : InputStream, OutputStream { size_t count; while (true) { version (Windows) { - count = _vsnprintf(p, psize, f, args); + count = vsnprintf(p, psize, f, args); if (count != -1) break; psize *= 2;