Restore usage of _fseeki64 and _ftelli64 on Windows (#2185)

These overrides were removed in b732f59472,
but that broke handling of >2GiB files for `seekSize`.
This commit is contained in:
Rangi authored and GitHub committed 2026-09-28 23:36:02 -04:00
1 parent 1d4c741975
commit 7b7bb57bcb
1 file changed
+7
+7
View File
@@ -67,6 +67,13 @@
#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__)
#include <stdio.h> // IWYU pragma: export
#define fseek _fseeki64
#define ftell _ftelli64
#endif
// Apple has deprecated `sprintf` since Xcode 14 (for macOS 13), but we use it solely in
// contexts where both the size of the buffer *and* max size of the printed string are
// known statically, which GCC thus checks for.