make tests green again
This commit is contained in:
parent
3caf108425
commit
d23eb79849
2 changed files with 5 additions and 4 deletions
|
|
@ -17,9 +17,12 @@
|
||||||
const
|
const
|
||||||
NilLibHandle: LibHandle = nil
|
NilLibHandle: LibHandle = nil
|
||||||
|
|
||||||
|
proc c_fwrite(buf: pointer, size, n: csize, f: File): cint {.
|
||||||
|
importc: "fwrite", header: "<stdio.h>".}
|
||||||
|
|
||||||
proc rawWrite(f: File, s: string) =
|
proc rawWrite(f: File, s: string) =
|
||||||
# we cannot throw an exception here!
|
# we cannot throw an exception here!
|
||||||
discard writeBuffer(f, cstring(s), s.len)
|
discard c_fwrite(cstring(s), 1, s.len, f)
|
||||||
|
|
||||||
proc nimLoadLibraryError(path: string) =
|
proc nimLoadLibraryError(path: string) =
|
||||||
# carefully written to avoid memory allocation:
|
# carefully written to avoid memory allocation:
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,6 @@ proc c_ferror(f: File): cint {.
|
||||||
importc: "ferror", header: "<stdio.h>", tags: [].}
|
importc: "ferror", header: "<stdio.h>", tags: [].}
|
||||||
proc c_setvbuf(f: File, buf: pointer, mode: cint, size: csize): cint {.
|
proc c_setvbuf(f: File, buf: pointer, mode: cint, size: csize): cint {.
|
||||||
importc: "setvbuf", header: "<stdio.h>", tags: [].}
|
importc: "setvbuf", header: "<stdio.h>", tags: [].}
|
||||||
proc c_fwrite(buf: pointer, size, n: csize, f: File): cint {.
|
|
||||||
importc: "fwrite", header: "<stdio.h>".}
|
|
||||||
|
|
||||||
proc raiseEIO(msg: string) {.noinline, noreturn.} =
|
proc raiseEIO(msg: string) {.noinline, noreturn.} =
|
||||||
sysFatal(IOError, msg)
|
sysFatal(IOError, msg)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue