From e92b90bbf8580219a876c10d8a3cddf9cefec9f2 Mon Sep 17 00:00:00 2001 From: ZombineDev Date: Tue, 14 Jun 2016 14:43:45 +0300 Subject: [PATCH] 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). --- src/dfmt/main.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dfmt/main.d b/src/dfmt/main.d index 7f4e7b6..3adc618 100644 --- a/src/dfmt/main.d +++ b/src/dfmt/main.d @@ -113,10 +113,10 @@ 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; + import std.stdio : _fileno, _O_BINARY, _setmode; - immutable fd = fileno(output.getFP()); - setmode(fd, _O_BINARY); + immutable fd = _fileno(output.getFP()); + _setmode(fd, _O_BINARY); version (CRuntime_DigitalMars) { import core.atomic : atomicOp;