fix #263, Impossible to build under Windows with phobos 2.072

This commit is contained in:
Basile Burg 2016-11-11 23:04:28 +01:00
parent 7961bfc15f
commit 593b9885ff
1 changed files with 15 additions and 3 deletions

View File

@ -113,9 +113,8 @@ else
// On Windows, set stdout to binary mode (needed for correct EOL writing)
// See Phobos' stdio.File.rawWrite
{
import std.stdio : _fileno, _O_BINARY, _setmode;
immutable fd = _fileno(output.getFP());
import std.stdio : _O_BINARY;
immutable fd = output.fileno;
_setmode(fd, _O_BINARY);
version (CRuntime_DigitalMars)
{
@ -212,6 +211,19 @@ else
}
}
private version (Windows)
{
version(CRuntime_DigitalMars)
{
extern(C) int setmode(int, int) nothrow @nogc;
alias _setmode = setmode;
}
else version(CRuntime_Microsoft)
{
extern(C) int _setmode(int, int) nothrow @nogc;
}
}
private string optionsToString(E)() if (is(E == enum))
{
import std.traits : EnumMembers;