portability: make tcc_get_symbol() available for non-native
For consistency with tcc_add_symbol(). Use uintptr_t here also.
This commit is contained in:
parent
60e647f856
commit
e0aee4f455
1 changed files with 2 additions and 2 deletions
4
tccelf.c
4
tccelf.c
|
@ -172,13 +172,13 @@ ST_FUNC addr_t get_elf_sym_addr(TCCState *s, const char *name, int err)
|
||||||
return sym->st_value;
|
return sym->st_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TCC_IS_NATIVE
|
|
||||||
/* return elf symbol value */
|
/* return elf symbol value */
|
||||||
LIBTCCAPI void *tcc_get_symbol(TCCState *s, const char *name)
|
LIBTCCAPI void *tcc_get_symbol(TCCState *s, const char *name)
|
||||||
{
|
{
|
||||||
return (void*)get_elf_sym_addr(s, name, 0);
|
return (void*)(uintptr_t)get_elf_sym_addr(s, name, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TCC_IS_NATIVE
|
||||||
/* return elf symbol value or error */
|
/* return elf symbol value or error */
|
||||||
ST_FUNC void* tcc_get_symbol_err(TCCState *s, const char *name)
|
ST_FUNC void* tcc_get_symbol_err(TCCState *s, const char *name)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue