From e2f412145f30e3d68eb58fd1456f48de2e0b6614 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Mon, 24 Oct 2022 17:25:34 +0200 Subject: [PATCH] fix fwrite prototype (#20644) * fix fwrite prototype * Update lib/std/syncio.nim Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> --- lib/std/syncio.nim | 2 +- lib/system/ansi_c.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/syncio.nim b/lib/std/syncio.nim index dadad97918..d406c254f9 100644 --- a/lib/std/syncio.nim +++ b/lib/std/syncio.nim @@ -105,7 +105,7 @@ proc c_feof(f: File): cint {. importc: "feof", header: "".} when not declared(c_fwrite): - proc c_fwrite(buf: pointer, size, n: csize_t, f: File): cint {. + proc c_fwrite(buf: pointer, size, n: csize_t, f: File): csize_t {. importc: "fwrite", header: "".} # C routine that is used here: diff --git a/lib/system/ansi_c.nim b/lib/system/ansi_c.nim index ae4b905048..a8a4bd7678 100644 --- a/lib/system/ansi_c.nim +++ b/lib/system/ansi_c.nim @@ -211,7 +211,7 @@ else: proc c_realloc*(p: pointer, newsize: csize_t): pointer {. importc: "realloc", header: "".} -proc c_fwrite*(buf: pointer, size, n: csize_t, f: CFilePtr): cint {. +proc c_fwrite*(buf: pointer, size, n: csize_t, f: CFilePtr): csize_t {. importc: "fwrite", header: "".} proc c_fflush*(f: CFilePtr): cint {.