From 40e3b5798a66095ded8f5ba0f45ba211f07d531d Mon Sep 17 00:00:00 2001 From: Volodymyr Melnychuk Date: Fri, 9 Feb 2018 10:34:26 +0200 Subject: [PATCH] Fix undefined reference with MinGw (#7175) * fix undefined reference with mingw * use fseek, ftell for x86 and _fseeki64, _ftelli64 for amd64 --- lib/system/sysio.nim | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index 71cbb1c21b..285bf1adc8 100644 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -48,10 +48,16 @@ when not declared(c_fwrite): proc c_fread(buf: pointer, size, n: csize, f: File): csize {. importc: "fread", header: "", tags: [ReadIOEffect].} when defined(windows): - proc c_fseek(f: File, offset: int64, whence: cint): cint {. - importc: "_fseeki64", header: "", tags: [].} - proc c_ftell(f: File): int64 {. - importc: "_ftelli64", header: "", tags: [].} + when not defined(amd64): + proc c_fseek(f: File, offset: int64, whence: cint): cint {. + importc: "fseek", header: "", tags: [].} + proc c_ftell(f: File): int64 {. + importc: "ftell", header: "", tags: [].} + else: + proc c_fseek(f: File, offset: int64, whence: cint): cint {. + importc: "_fseeki64", header: "", tags: [].} + proc c_ftell(f: File): int64 {. + importc: "_ftelli64", header: "", tags: [].} else: proc c_fseek(f: File, offset: int64, whence: cint): cint {. importc: "fseeko", header: "", tags: [].}