[Zlib-devel] Explicit link to libc
John Bowler
jbowler at frontiernet.net
Sun Apr 4 02:29:04 EDT 2010
From: Mark Adler
>Can we apply this same solution somehow in Windows? Or has
>this problem been faced in the Windows world with a different
>standard solution?
I believe Windows NT always supported 64 bit sized files and SetFilePos has two arguments, the low 32 bits and, optionally, the high (SetFilePosEx does it properly with LARGE_INTEGER.)
The runtime, the C support library, seems to use the approach of providing a second API. 'fseek' is 32 bit throughout, but _fseeki64 is the same with a 64 bit offset (likewise _ftelli64). That makes sense to me because fseek/ftell are actually speced in ANSI-C to return 'int'.
One other approach is to do fsetpos/fgetpos, because fpos_t is always an implementation defined type and, on Windows, it's always 64 bit (I think), but implemented in sub-plaform specific ways (struct, __int64 etc.)
John Bowler <jbowler at acm.org>
More information about the Zlib-devel
mailing list