diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2018-02-27 13:39:18 +0200 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2018-02-27 13:43:09 +0200 |
commit | 2be4fd887755106443669b1dd3760fc81ccab856 (patch) | |
tree | e14a3d947740cb0a633c181af7abdfc76d3d1e3b /src | |
parent | 24105f625935b3a541a511c22a3489fe38fbe6cc (diff) |
libc: Togglable libstdc++ support
Can use either host libstdc++ or android's
where android's is probably must for anything other than clang or gcc
Diffstat (limited to 'src')
-rw-r--r-- | src/libc.c | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -354,9 +354,27 @@ bionic_sysconf(int name) return sysconf(bionic_sysconf_to_glibc_sysconf(name)); } +#if 1 +// gcc's libstdc++ void* bionic___dynamic_cast(const void *src_ptr, const void *src_type, const void *dst_type, intptr_t src2dst) { - // HACK: we should use android's various libstdc++ implementations instead. return (void*)src_ptr; } +#else +// android's libstdc++ +# include <sys/time.h> +# include <linux/futex.h> + +int +bionic___futex_wait(volatile void* ftx, int value, const struct timespec* timeout) +{ + return syscall(SYS_futex, ftx, FUTEX_WAIT, value, timeout, 0); +} + +int +bionic___futex_wake(volatile void* ftx, int count) +{ + return syscall(SYS_futex, ftx, FUTEX_WAKE, count, NULL, 0); +} +#endif |