Fix the Fseek() and Fseektell() implementation when using the libretro VFS

This commit is contained in:
刘皓 committed 2026-01-08 11:55:13 -05:00
1 parent 51e3eb69af
commit 37047106f3
1 file changed
+2 -2
+2 -2
View File
@@ -1231,7 +1231,7 @@ int Fseek(FILE *file, int64_t offset, int whence) {
whence = RETRO_VFS_SEEK_POSITION_END;
break;
}
return filestream_seek(file, offset, whence) == -1 ? -1 : 0;
return filestream_seek(file, offset, whence) != 0 ? -1 : 0;
#elif defined(_WIN32)
return _fseeki64(file, offset, whence);
#elif defined(__ANDROID__) || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS < 64)
@@ -1254,7 +1254,7 @@ int64_t Fseektell(FILE *file, int64_t offset, int whence) {
whence = RETRO_VFS_SEEK_POSITION_END;
break;
}
return filestream_seek(file, offset, whence) == -1 ? -1 : filestream_tell(file);
return filestream_seek(file, offset, whence) != 0 ? -1 : filestream_tell(file);
#elif defined(_WIN32)
return _fseeki64(file, offset, whence) != 0 ? -1 : _ftelli64(file);
#elif defined(__ANDROID__) || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS < 64)