From da0f5f371d7ef1549307b87f6fd2ee393582e350 Mon Sep 17 00:00:00 2001 From: barbudreadmon Date: Thu, 3 Oct 2024 07:12:31 +0200 Subject: [PATCH] ioapi: fix for libretro --- src/burner/ioapi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/burner/ioapi.c b/src/burner/ioapi.c index d99467825..4511c4916 100644 --- a/src/burner/ioapi.c +++ b/src/burner/ioapi.c @@ -14,9 +14,18 @@ #define _CRT_SECURE_NO_WARNINGS #endif +#if (defined(__APPLE__) || defined(IOAPI_NO_64) || defined(__HAIKU__) || defined(MINIZIP_FOPEN_NO_64)) && !defined(__LIBRETRO__) +// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions +#define FOPEN_FUNC(filename, mode) fopen(filename, mode) +#define FTELLO_FUNC(stream) ftello(stream) +#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin) +#else +// note: In libretro, we want to always use fopen64/ftello64/fseeko64, which are redirecting to fopen/ftell/fseek becausee we force USE_FILE32API, +// themselves redirecting to libretro's "file_stream_transform" abstraction layer. As of 2024-10-03, they don't have implementations for ftello/fseeko yet. #define FOPEN_FUNC(filename, mode) fopen64(filename, mode) #define FTELLO_FUNC(stream) ftello64(stream) #define FSEEKO_FUNC(stream, offset, origin) fseeko64(stream, offset, origin) +#endif #include "ioapi.h"