engine: platform: android: make dlsym-weak C++ again (because of struct soinfo definition). Reformat linker.h file as well.

This commit is contained in:
Alibek Omarov 2024-10-24 17:54:09 +03:00
parent 128a1f59a9
commit 224e42d345
3 changed files with 98 additions and 109 deletions

View file

@ -92,7 +92,7 @@ static Elf_Sym *dlsym_handle_lookup( const soinfo *si, const char *name )
return soinfo_elf_lookup( si, elfhash((const unsigned char *)name ), name ); return soinfo_elf_lookup( si, elfhash((const unsigned char *)name ), name );
} }
void *dlsym_weak( void *handle, const char *symbol ) extern "C" void *dlsym_weak( void *handle, const char *symbol )
{ {
soinfo *found = (soinfo *)handle; soinfo *found = (soinfo *)handle;
Elf_Sym *sym = dlsym_handle_lookup( found, symbol ); Elf_Sym *sym = dlsym_handle_lookup( found, symbol );

View file

@ -28,7 +28,6 @@
#ifndef _LINKER_H_ #ifndef _LINKER_H_
#define _LINKER_H_ #define _LINKER_H_
#ifdef __ANDROID__
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
@ -80,15 +79,6 @@ enum {
RT_ADD, RT_ADD,
RT_DELETE RT_DELETE
}; };
#if 0
struct r_debug {
int32_t r_version;
link_map_t* r_map;
void (*r_brk)(void);
int32_t r_state;
uintptr_t r_ldbase;
};
#endif
#define FLAG_LINKED 0x00000001 #define FLAG_LINKED 0x00000001
#define FLAG_EXE 0x00000004 // The main executable #define FLAG_EXE 0x00000004 // The main executable
#define FLAG_LINKER 0x00000010 // The linker itself #define FLAG_LINKER 0x00000010 // The linker itself
@ -198,4 +188,3 @@ struct soinfo {
}; };
#endif #endif
#endif

View file

@ -191,7 +191,7 @@ def build(bld):
if bld.env.DEST_OS == 'android': if bld.env.DEST_OS == 'android':
libs += ['LOG'] libs += ['LOG']
source += bld.path.ant_glob(['platform/android/*.c', 'platform/linux/*.c']) source += bld.path.ant_glob(['platform/android/*.cpp', 'platform/android/*.c', 'platform/linux/*.c'])
if bld.env.DEST_OS == 'nswitch': if bld.env.DEST_OS == 'nswitch':
libs += [ 'SOLDER' ] libs += [ 'SOLDER' ]