113113 // On Windows, set stdout to binary mode (needed for correct EOL writing)
114114 // See Phobos' stdio.File.rawWrite
115115 {
116- import std.stdio : _fileno, _O_BINARY, _setmode;
117-
118- immutable fd = _fileno(output.getFP());
116+ import std.stdio : _O_BINARY;
117+ immutable fd = output.fileno;
119118 _setmode(fd, _O_BINARY);
120119 version (CRuntime_DigitalMars )
121120 {
@@ -212,6 +211,19 @@ else
212211 }
213212}
214213
214+ private version (Windows)
215+ {
216+ version (CRuntime_DigitalMars )
217+ {
218+ extern (C ) int setmode(int , int ) nothrow @nogc ;
219+ alias _setmode = setmode;
220+ }
221+ else version (CRuntime_Microsoft )
222+ {
223+ extern (C ) int _setmode(int , int ) nothrow @nogc ;
224+ }
225+ }
226+
215227private string optionsToString (E)() if (is (E == enum ))
216228{
217229 import std.traits : EnumMembers;
@@ -236,7 +248,7 @@ https://github.com/Hackerpilot/dfmt
236248Options:
237249 --help, -h Print this help message
238250 --inplace, -i Edit files in place
239- --config_dir, -c Path to directory to load .editconfig file from.
251+ --config_dir, -c Path to directory to load .editorconfig file from.
240252 --version Print the version number and then exit
241253
242254Formatting Options:
0 commit comments