Use _fseeki64/_ftelli64 on Windows since fseek/fell are limited by 32-bit long

This commit is contained in:
Rangi
2026-07-21 14:38:14 -04:00
parent c691ec6607
commit 50678d0942
3 changed files with 9 additions and 2 deletions
+6
View File
@@ -55,6 +55,12 @@
#define setmode(fd, mode) (0)
#endif
// Windows has 32-bit `long`, which limits `fseek` and `ftell` to 2 GiB
#if defined(_MSC_VER) || defined(__MINGW32__)
#define fseek _fseeki64
#define ftell _ftelli64
#endif
// MingGW and Cygwin need POSIX functions which are not standard C explicitly enabled,
#if defined(__MINGW32__) || defined(__CYGWIN__)
#define _POSIX_C_SOURCE 200809L