mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-20 21:43:50 +00:00
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 <ralph.sennhauser@gmail.com>
This commit is contained in:
@@ -42,41 +42,6 @@
|
||||
#include <fcntl.h>
|
||||
#include <string>
|
||||
|
||||
#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 <dlfcn.h>
|
||||
|
||||
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));
|
||||
|
||||
Reference in New Issue
Block a user