Fix compilation in Windows for CRuntime_Microsoft
Use _setmode instead of setmode, because it works for all supported C runtimes on Windows. This should fix compilation errors for dmd -m32coff, m64, and ldc2 (LDC uses only CRuntime_Microsoft).
This commit is contained in:
parent
90b68b7e57
commit
e92b90bbf8
src/dfmt
|
@ -113,10 +113,10 @@ else
|
||||||
// On Windows, set stdout to binary mode (needed for correct EOL writing)
|
// On Windows, set stdout to binary mode (needed for correct EOL writing)
|
||||||
// See Phobos' stdio.File.rawWrite
|
// See Phobos' stdio.File.rawWrite
|
||||||
{
|
{
|
||||||
import std.stdio : fileno, _O_BINARY, setmode;
|
import std.stdio : _fileno, _O_BINARY, _setmode;
|
||||||
|
|
||||||
immutable fd = fileno(output.getFP());
|
immutable fd = _fileno(output.getFP());
|
||||||
setmode(fd, _O_BINARY);
|
_setmode(fd, _O_BINARY);
|
||||||
version (CRuntime_DigitalMars)
|
version (CRuntime_DigitalMars)
|
||||||
{
|
{
|
||||||
import core.atomic : atomicOp;
|
import core.atomic : atomicOp;
|
||||||
|
|
Loading…
Reference in New Issue