From c28a9236404f38dbb6b4f139d290223cff61ebc2 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Fri, 26 Jun 2026 19:53:42 -0400 Subject: [PATCH] libretro: Fix VFS fseek's return value --- src/libchdr_chd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libchdr_chd.c b/src/libchdr_chd.c index 43a527d..b66b9fd 100644 --- a/src/libchdr_chd.c +++ b/src/libchdr_chd.c @@ -2166,7 +2166,8 @@ static void *core_stdio_fopen(char const *path) { -------------------------------------------------*/ static uint64_t core_stdio_fsize(void *file) { #if defined USE_LIBRETRO_VFS - #define core_stdio_fseek_impl fseek + /* The libretro VFS fseek returns the new file position, so we adapt it as needed. */ + #define core_stdio_fseek_impl(file,offset,whence) (fseek(file, offset, whence) < 0 ? -1 : 0) #define core_stdio_ftell_impl ftell #elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WIN64__) #define core_stdio_fseek_impl _fseeki64