|
@@ -292,6 +292,23 @@ windows_file_close(SDL_RWops * context)
|
|
|
|
|
|
#ifdef HAVE_STDIO_H
|
|
|
|
|
|
+#ifdef HAVE_FOPEN64
|
|
|
+#define fopen fopen64
|
|
|
+#endif
|
|
|
+#ifdef HAVE_FSEEKO64
|
|
|
+#define fseek_off_t off64_t
|
|
|
+#define fseek fseeko64
|
|
|
+#define ftell ftello64
|
|
|
+#elif defined(HAVE_FSEEKO)
|
|
|
+#define fseek_off_t off_t
|
|
|
+#define fseek fseeko
|
|
|
+#define ftell ftello
|
|
|
+#elif defined(HAVE__FSEEKI64)
|
|
|
+#define fseek_off_t __int64
|
|
|
+#define fseek _fseeki64
|
|
|
+#define ftell _ftelli64
|
|
|
+#endif
|
|
|
+
|
|
|
/* Functions to read/write stdio file pointers */
|
|
|
|
|
|
static Sint64 SDLCALL
|
|
@@ -312,23 +329,9 @@ stdio_size(SDL_RWops * context)
|
|
|
static Sint64 SDLCALL
|
|
|
stdio_seek(SDL_RWops * context, Sint64 offset, int whence)
|
|
|
{
|
|
|
-#ifdef HAVE_FSEEKO64
|
|
|
- if (fseeko64(context->hidden.stdio.fp, (off64_t)offset, whence) == 0) {
|
|
|
- return ftello64(context->hidden.stdio.fp);
|
|
|
- }
|
|
|
-#elif defined(HAVE_FSEEKO)
|
|
|
- if (fseeko(context->hidden.stdio.fp, (off_t)offset, whence) == 0) {
|
|
|
- return ftello(context->hidden.stdio.fp);
|
|
|
- }
|
|
|
-#elif defined(HAVE__FSEEKI64)
|
|
|
- if (_fseeki64(context->hidden.stdio.fp, offset, whence) == 0) {
|
|
|
- return _ftelli64(context->hidden.stdio.fp);
|
|
|
- }
|
|
|
-#else
|
|
|
- if (fseek(context->hidden.stdio.fp, offset, whence) == 0) {
|
|
|
+ if (fseek(context->hidden.stdio.fp, (fseek_off_t)offset, whence) == 0) {
|
|
|
return ftell(context->hidden.stdio.fp);
|
|
|
}
|
|
|
-#endif
|
|
|
return SDL_Error(SDL_EFSEEK);
|
|
|
}
|
|
|
|