make c_setmode compatible with Borland C; refs #5157

This commit is contained in:
Andreas Rumpf
2016-12-31 03:04:10 +01:00
parent 072f932575
commit 33b8ade07c

View File

@@ -2725,8 +2725,9 @@ when not defined(JS): #and not defined(nimscript):
when defined(windows):
# work-around C's sucking abstraction:
# BUGFIX: stdin and stdout should be binary files!
proc c_setmode(handle, mode: cint) {.importc: "_setmode",
header: "<io.h>".}
proc c_setmode(handle, mode: cint) {.
importc: when defined(bcc): "setmode" else: "_setmode",
header: "<io.h>".}
var
O_BINARY {.importc: "O_BINARY", nodecl.}: cint