summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/system/dyncalls.nim7
-rw-r--r--lib/system/sysio.nim2
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/system/dyncalls.nim b/lib/system/dyncalls.nim
index fa997e982..e1938eb2b 100644
--- a/lib/system/dyncalls.nim
+++ b/lib/system/dyncalls.nim
@@ -17,9 +17,12 @@
 const
   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) =
   # 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) =
   # carefully written to avoid memory allocation:
@@ -126,7 +129,7 @@ elif defined(windows) or defined(dos):
     decorated[m] = '@'
     for i in countup(0, 50):
       var k = i * 4
-      if k div 100 == 0: 
+      if k div 100 == 0:
         if k div 10 == 0:
           m = m + 1
         else:
diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim
index 9a2fb920a..e8ff6a35d 100644
--- a/lib/system/sysio.nim
+++ b/lib/system/sysio.nim
@@ -48,8 +48,6 @@ proc c_ferror(f: File): cint {.
   importc: "ferror", header: "<stdio.h>", tags: [].}
 proc c_setvbuf(f: File, buf: pointer, mode: cint, size: csize): cint {.
   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.} =
   sysFatal(IOError, msg)