From 2be4fd887755106443669b1dd3760fc81ccab856 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Tue, 27 Feb 2018 13:39:18 +0200 Subject: 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 --- src/libc.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libc.c b/src/libc.c index dba8853..66b0d8d 100644 --- a/src/libc.c +++ b/src/libc.c @@ -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 +# include + +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 -- cgit v1.2.3-70-g09d2