diff options
Diffstat (limited to 'lib/system/ansi_c.nim')
-rw-r--r-- | lib/system/ansi_c.nim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/system/ansi_c.nim b/lib/system/ansi_c.nim index 0b4b25992..4839407c1 100644 --- a/lib/system/ansi_c.nim +++ b/lib/system/ansi_c.nim @@ -154,6 +154,11 @@ proc c_fwrite*(buf: pointer, size, n: csize_t, f: CFilePtr): cint {. proc c_fflush(f: CFilePtr): cint {. importc: "fflush", header: "<stdio.h>".} +proc rawWriteString*(f: CFilePtr, s: cstring, length: int) {.compilerproc, nonReloadable, inline.} = + # we cannot throw an exception here! + discard c_fwrite(s, 1, cast[csize_t](length), f) + discard c_fflush(f) + proc rawWrite*(f: CFilePtr, s: cstring) {.compilerproc, nonReloadable, inline.} = # we cannot throw an exception here! discard c_fwrite(s, 1, cast[csize_t](s.len), f) |