From 593b9885ff9b3b6d43fb4c149beedda89ed914ff Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Fri, 11 Nov 2016 23:04:28 +0100 Subject: [PATCH 1/2] fix #263, Impossible to build under Windows with phobos 2.072 --- src/dfmt/main.d | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/dfmt/main.d b/src/dfmt/main.d index 3adc618..af26f58 100644 --- a/src/dfmt/main.d +++ b/src/dfmt/main.d @@ -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; From d95d69e31b3fcddbabbb1111886b66ddc3692e0c Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 14 Nov 2016 16:59:18 +0100 Subject: [PATCH 2/2] Fix typo in help message `.editconfig` should be `.editorconfig` instead. --- src/dfmt/main.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dfmt/main.d b/src/dfmt/main.d index 3adc618..2358e48 100644 --- a/src/dfmt/main.d +++ b/src/dfmt/main.d @@ -236,7 +236,7 @@ https://github.com/Hackerpilot/dfmt Options: --help, -h Print this help message --inplace, -i Edit files in place - --config_dir, -c Path to directory to load .editconfig file from. + --config_dir, -c Path to directory to load .editorconfig file from. --version Print the version number and then exit Formatting Options: