--newruntime: progress

This commit is contained in:
Andreas Rumpf 2019-03-14 19:53:14 +01:00
commit e263702688
15 changed files with 111 additions and 109 deletions

View file

@ -139,4 +139,11 @@ proc c_free(p: pointer) {.
proc c_realloc(p: pointer, newsize: csize): pointer {.
importc: "realloc", header: "<stdlib.h>".}
proc c_fwrite(buf: pointer, size, n: csize, f: CFilePtr): cint {.
importc: "fwrite", header: "<stdio.h>".}
proc rawWrite(f: CFilePtr, s: cstring) {.compilerproc, nonreloadable, inline.} =
# we cannot throw an exception here!
discard c_fwrite(s, 1, s.len, f)
{.pop}