summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-07-01 14:10:08 +0200
committerGitHub <noreply@github.com>2019-07-01 14:10:08 +0200
commit9b949855c7071749a459809f12da21d827eedc9d (patch)
tree721723715ca81dd6142dd0a8dc1a7193fbc2189a
parent2c10b246ec8319a9f065d5ef50fc891eeffc7ad9 (diff)
downloadNim-9b949855c7071749a459809f12da21d827eedc9d.tar.gz
fixes #11618 (#11631)
-rw-r--r--changelog_v020.md2
-rw-r--r--lib/system/io.nim2
2 files changed, 3 insertions, 1 deletions
diff --git a/changelog_v020.md b/changelog_v020.md
index 2ce0bbd10..69271448d 100644
--- a/changelog_v020.md
+++ b/changelog_v020.md
@@ -11,6 +11,8 @@
   then you need to change that to `rfind X, last=N` or `rfind X, 0, N`. (This
   should minimize gotchas porting code from other languages like Python or C++.)
 
+- On Windows stderr/stdout/stdin are not opened as binary files anymore. Use the switch
+  `-d:nimBinaryStdFiles` for a transition period.
 
 ### Breaking changes in the standard library
 
diff --git a/lib/system/io.nim b/lib/system/io.nim
index 4497b1b0b..b967d0827 100644
--- a/lib/system/io.nim
+++ b/lib/system/io.nim
@@ -569,7 +569,7 @@ when declared(stdout):
       releaseSys echoLock
 
 
-when defined(windows) and not defined(nimscript):
+when defined(windows) and not defined(nimscript) and defined(nimBinaryStdFiles):
   # work-around C's sucking abstraction:
   # BUGFIX: stdin and stdout should be binary files!
   proc c_setmode(handle, mode: cint) {.