fixes to allow the usage of clang on windows with the msvc abi and ms headers (#6442)

This commit is contained in:
Charlie Barto 2017-10-09 11:26:53 -04:00 • committed by Andreas Rumpf
commit d55e02ddf1
5 changed files with 20 additions and 18 deletions

View file

@ -103,8 +103,12 @@ proc c_sprintf(buf, frmt: cstring): cint {.
importc: "sprintf", header: "<stdio.h>", varargs, noSideEffect.}
# we use it only in a way that cannot lead to security issues
proc c_fileno(f: File): cint {.
importc: "fileno", header: "<fcntl.h>".}
when defined(windows):
proc c_fileno(f: File): cint {.
importc: "_fileno", header: "<stdio.h>".}
else:
proc c_fileno(f: File): cint {.
importc: "fileno", header: "<fcntl.h>".}
proc c_malloc(size: csize): pointer {.
importc: "malloc", header: "<stdlib.h>".}