termux-packages/x11-packages/libsdl2/SDL2-2.0.8_src_file_SDL_rwo...

65 lines
2.0 KiB
Diff

diff -uNr SDL2-2.0.8/src/file/SDL_rwops.c SDL2-2.0.8.mod/src/file/SDL_rwops.c
--- SDL2-2.0.8/src/file/SDL_rwops.c 2018-03-01 18:34:42.000000000 +0200
+++ SDL2-2.0.8.mod/src/file/SDL_rwops.c 2018-09-07 16:08:37.898133057 +0300
@@ -51,10 +51,6 @@
#include "cocoa/SDL_rwopsbundlesupport.h"
#endif /* __APPLE__ */
-#ifdef __ANDROID__
-#include "../core/android/SDL_android.h"
-#include "SDL_system.h"
-#endif
#if __NACL__
#include "nacl_io/nacl_io.h"
@@ -515,48 +511,7 @@
SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
return NULL;
}
-#if defined(__ANDROID__)
-#ifdef HAVE_STDIO_H
- /* Try to open the file on the filesystem first */
- if (*file == '/') {
- FILE *fp = fopen(file, mode);
- if (fp) {
- return SDL_RWFromFP(fp, 1);
- }
- } else {
- /* Try opening it from internal storage if it's a relative path */
- char *path;
- FILE *fp;
-
- path = SDL_stack_alloc(char, PATH_MAX);
- if (path) {
- SDL_snprintf(path, PATH_MAX, "%s/%s",
- SDL_AndroidGetInternalStoragePath(), file);
- fp = fopen(path, mode);
- SDL_stack_free(path);
- if (fp) {
- return SDL_RWFromFP(fp, 1);
- }
- }
- }
-#endif /* HAVE_STDIO_H */
-
- /* Try to open the file from the asset system */
- rwops = SDL_AllocRW();
- if (!rwops)
- return NULL; /* SDL_SetError already setup by SDL_AllocRW() */
- if (Android_JNI_FileOpen(rwops, file, mode) < 0) {
- SDL_FreeRW(rwops);
- return NULL;
- }
- rwops->size = Android_JNI_FileSize;
- rwops->seek = Android_JNI_FileSeek;
- rwops->read = Android_JNI_FileRead;
- rwops->write = Android_JNI_FileWrite;
- rwops->close = Android_JNI_FileClose;
- rwops->type = SDL_RWOPS_JNIFILE;
-
-#elif defined(__WIN32__)
+#if defined(__WIN32__)
rwops = SDL_AllocRW();
if (!rwops)
return NULL; /* SDL_SetError already setup by SDL_AllocRW() */