Fix createTempFile on Windows.
This commit is contained in:
parent
9e492ab4f1
commit
1d9e88f27a
|
@ -79,7 +79,7 @@ before_build:
|
||||||
$env:Darch = "x86";
|
$env:Darch = "x86";
|
||||||
}
|
}
|
||||||
elseif($env:arch -eq "x86_mscoff"){
|
elseif($env:arch -eq "x86_mscoff"){
|
||||||
$env:compilersetupargs = "amd64";
|
$env:compilersetupargs = "x86";
|
||||||
$env:Darch = "x86_mscoff";
|
$env:Darch = "x86_mscoff";
|
||||||
}
|
}
|
||||||
elseif($env:arch -eq "x64"){
|
elseif($env:arch -eq "x64"){
|
||||||
|
|
|
@ -144,9 +144,9 @@ FileStream createTempFile(string suffix = null)
|
||||||
import std.conv : to;
|
import std.conv : to;
|
||||||
string tmpname;
|
string tmpname;
|
||||||
() @trusted {
|
() @trusted {
|
||||||
char[L_tmpnam] tmp;
|
auto fn = tmpnam(null);
|
||||||
tmpnam(tmp.ptr);
|
enforce(fn !is null, "Failed to generate temporary name.");
|
||||||
tmpname = to!string(tmp.ptr);
|
tmpname = to!string(fn);
|
||||||
} ();
|
} ();
|
||||||
if (tmpname.startsWith("\\")) tmpname = tmpname[1 .. $];
|
if (tmpname.startsWith("\\")) tmpname = tmpname[1 .. $];
|
||||||
tmpname ~= suffix;
|
tmpname ~= suffix;
|
||||||
|
|
Loading…
Reference in a new issue