mirror of
https://github.com/gbdev/rgbds.git
synced 2026-10-03 10:45:37 +00:00
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:
1 parent
1d4c741975
commit
7b7bb57bcb
1 file changed
+7
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user