Fix undefined reference with MinGw (#7175)

* fix undefined reference with mingw
* use fseek, ftell for x86 and _fseeki64, _ftelli64 for amd64
This commit is contained in:
Volodymyr Melnychuk
2018-02-09 10:34:26 +02:00
committed by Andreas Rumpf
parent 70e8640244
commit 40e3b5798a

View File

@@ -48,10 +48,16 @@ when not declared(c_fwrite):
proc c_fread(buf: pointer, size, n: csize, f: File): csize {.
importc: "fread", header: "<stdio.h>", tags: [ReadIOEffect].}
when defined(windows):
proc c_fseek(f: File, offset: int64, whence: cint): cint {.
importc: "_fseeki64", header: "<stdio.h>", tags: [].}
proc c_ftell(f: File): int64 {.
importc: "_ftelli64", header: "<stdio.h>", tags: [].}
when not defined(amd64):
proc c_fseek(f: File, offset: int64, whence: cint): cint {.
importc: "fseek", header: "<stdio.h>", tags: [].}
proc c_ftell(f: File): int64 {.
importc: "ftell", header: "<stdio.h>", tags: [].}
else:
proc c_fseek(f: File, offset: int64, whence: cint): cint {.
importc: "_fseeki64", header: "<stdio.h>", tags: [].}
proc c_ftell(f: File): int64 {.
importc: "_ftelli64", header: "<stdio.h>", tags: [].}
else:
proc c_fseek(f: File, offset: int64, whence: cint): cint {.
importc: "fseeko", header: "<stdio.h>", tags: [].}