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:
parent
70e8640244
commit
40e3b5798a
1 changed files with 10 additions and 4 deletions
|
|
@ -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: [].}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue