portability: make tcc_get_symbol() available for non-native
authorgrischka <grischka>
Mon, 4 Feb 2013 19:57:57 +0000 (4 20:57 +0100)
committergrischka <grischka>
Mon, 4 Feb 2013 19:57:57 +0000 (4 20:57 +0100)
For consistency with tcc_add_symbol().
Use uintptr_t here also.

tccelf.c

index ced61fc..4b8c9a0 100644 (file)
--- a/tccelf.c
+++ b/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;
 }
 
-#ifdef TCC_IS_NATIVE
 /* return elf symbol value */
 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 */
 ST_FUNC void* tcc_get_symbol_err(TCCState *s, const char *name)
 {