Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.067: Experimental MSVCRT 14 (VS 2015) support #17

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions std/conv.d
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
9 changes: 6 additions & 3 deletions std/format.d
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion std/outbuffer.d
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion std/stream.d
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down