parent
bc1db0d6f1
commit
c555525227
3 changed files with 33 additions and 10 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue