From fe4b425576e11391150cc233fb293dab3e15430c Mon Sep 17 00:00:00 2001 From: Craig Carnell <1188869+cscd98@users.noreply.github.com> Date: Tue, 11 Aug 2026 22:10:14 +0100 Subject: [PATCH] libretro: android/msvc related build fixes --- jni/Android.mk | 5 ++++- src/cart.c | 8 ++++++-- src/intv.c | 16 ++++++++++++---- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/jni/Android.mk b/jni/Android.mk index 47db12e..8a075c1 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -22,14 +22,17 @@ ANDROID_SOURCES_C := \ ../src/stic.c \ ../src/stb_image_impl.c \ ../src/deps/libretro-common/file/file_path.c \ + ../src/deps/libretro-common/file/file_path_io.c \ ../src/deps/libretro-common/compat/compat_posix_string.c \ ../src/deps/libretro-common/compat/compat_snprintf.c \ ../src/deps/libretro-common/compat/compat_strl.c \ ../src/deps/libretro-common/compat/compat_strcasestr.c \ ../src/deps/libretro-common/compat/fopen_utf8.c \ ../src/deps/libretro-common/encodings/encoding_utf.c \ + ../src/deps/libretro-common/streams/file_stream.c \ ../src/deps/libretro-common/string/stdstring.c \ - ../src/deps/libretro-common/time/rtime.c + ../src/deps/libretro-common/time/rtime.c \ + ../src/deps/libretro-common/vfs/vfs_implementation.c include $(CLEAR_VARS) LOCAL_MODULE := retro diff --git a/src/cart.c b/src/cart.c index f7d534d..08b47ed 100644 --- a/src/cart.c +++ b/src/cart.c @@ -51,12 +51,17 @@ int LoadCart(const char *path) { unsigned char word[1]; +#ifdef __LIBRETRO__ + RFILE *fp; +#else + FILE *fp; +#endif + printf("[INFO] [FREEINTV] Attempting to load cartridge ROM from: %s\n", path); size = 0; #ifdef __LIBRETRO__ - RFILE *fp; if((fp = filestream_open(path, RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE)) != NULL) { while(filestream_read(fp, word, sizeof(word)) == sizeof(word) && size<0x20000) @@ -67,7 +72,6 @@ int LoadCart(const char *path) filestream_close(fp); printf("[INFO] [FREEINTV] Cartridge load complete: %d bytes read\n", size); #else - FILE *fp; if((fp = fopen(path,"rb"))!=NULL) { while(fread(word,sizeof(word),1,fp) && size<0x20000) diff --git a/src/intv.c b/src/intv.c index 5637f3a..dbfacfa 100644 --- a/src/intv.c +++ b/src/intv.c @@ -55,7 +55,12 @@ void loadExec(const char* path) unsigned char word[2]; #ifdef __LIBRETRO__ - RFILE *fp; + RFILE *fp; +#else + FILE *fp; +#endif + +#ifdef __LIBRETRO__ if((fp = filestream_open(path, RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE)) != NULL) { for(i=0x1000; i<=0x1FFF; i++) @@ -69,7 +74,6 @@ void loadExec(const char* path) printf("[INFO] [FREEINTV] Succeeded loading Executive BIOS from: %s\n", path); } #else - FILE *fp; if((fp = fopen(path,"rb"))!=NULL) { for(i=0x1000; i<=0x1FFF; i++) @@ -98,7 +102,12 @@ void loadGrom(const char* path) unsigned char word[1]; #ifdef __LIBRETRO__ - RFILE *fp; + RFILE *fp; +#else + FILE *fp; +#endif + +#ifdef __LIBRETRO__ if((fp = filestream_open(path, RETRO_VFS_FILE_ACCESS_READ, RETRO_VFS_FILE_ACCESS_HINT_NONE)) != NULL) { for(i=0x3000; i<=0x37FF; i++) @@ -112,7 +121,6 @@ void loadGrom(const char* path) printf("[INFO] [FREEINTV] Succeeded loading Graphics BIOS from: %s\n", path); } #else - FILE *fp; if((fp = fopen(path,"rb"))!=NULL) { for(i=0x3000; i<=0x37FF; i++)