diff options
author | Volodymyr Melnychuk <valdema_r@hotmail.com> | 2018-02-09 10:34:26 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-02-09 09:34:26 +0100 |
commit | 40e3b5798a66095ded8f5ba0f45ba211f07d531d (patch) | |
tree | bdab48d6e5617847b0a2e8a04507ea4ce68119d9 /lib | |
parent | 70e8640244e48e8d62c5af42101c9df2b57224d9 (diff) | |
download | Nim-40e3b5798a66095ded8f5ba0f45ba211f07d531d.tar.gz |
Fix undefined reference with MinGw (#7175)
* fix undefined reference with mingw * use fseek, ftell for x86 and _fseeki64, _ftelli64 for amd64
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system/sysio.nim | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index 71cbb1c21..285bf1adc 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: "<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: [].} |