From 3c0274c7ccc4205f16c74640c4000c801a080555 Mon Sep 17 00:00:00 2001 From: Ralph Sennhauser Date: Thu, 18 Jun 2026 19:47:36 +0200 Subject: [PATCH] Remove unused android filesystem helpers We don't use neither opendir nor readdir nor closedir. Further there are no callers for init_libc(). Signed-off-by: Ralph Sennhauser --- source/lib/sysdep/os/unix/ufilesystem.cpp | 35 ----------------------- 1 file changed, 35 deletions(-) diff --git a/source/lib/sysdep/os/unix/ufilesystem.cpp b/source/lib/sysdep/os/unix/ufilesystem.cpp index d0cd586296..2988536417 100644 --- a/source/lib/sysdep/os/unix/ufilesystem.cpp +++ b/source/lib/sysdep/os/unix/ufilesystem.cpp @@ -42,41 +42,6 @@ #include #include -#if OS_ANDROID - -// The Crystax NDK seems to do weird things with opendir etc. -// To avoid that, load the symbols directly from the real libc -// and use them instead. - -#include - -static void* libc; -static DIR* (*libc_opendir)(const char*); -static dirent* (*libc_readdir)(DIR*); -static int (*libc_closedir)(DIR*); - -void init_libc() -{ - if (libc) - return; - libc = dlopen("/system/lib/libc.so", RTLD_LAZY); - ENSURE(libc); - libc_opendir = (DIR*(*)(const char*))dlsym(libc, "opendir"); - libc_readdir = (dirent*(*)(DIR*))dlsym(libc, "readdir"); - libc_closedir = (int(*)(DIR*))dlsym(libc, "closedir"); - ENSURE(libc_opendir && libc_readdir && libc_closedir); -} - -#define opendir libc_opendir -#define readdir libc_readdir -#define closedir libc_closedir - -#else - -void init_libc() { } - -#endif - int wopen(const OsPath& pathname, int oflag) { ENSURE(!(oflag & O_CREAT));