libc: Fix cxxabi.h header (#1087)

- `__cxa_*` runtime functions are expected to be in the `abi` namespace,
which is currently an alias for `__cxxabiv1`.
- Rely on the header provided by `libcxxabi` for functions that we do
not implement ourselves anymore.
This commit is contained in:
Trung Nguyen 2024-01-16 02:50:38 +07:00 committed by GitHub
parent a2753de7fd
commit 6db1200a7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View file

@ -2,16 +2,18 @@
#define _CXXABI_H #define _CXXABI_H
COSMOPOLITAN_C_START_ COSMOPOLITAN_C_START_
union CxaGuardValue; #ifdef __cplusplus
namespace __cxxabiv1 {
#endif /* __cplusplus */
char *__cxa_demangle(const char *, char *, size_t *, int *); char *__cxa_demangle(const char *, char *, size_t *, int *);
int __cxa_atexit(void (*)(void *), void *, void *) paramsnonnull((1)) dontthrow; int __cxa_atexit(void (*)(void *), void *, void *) paramsnonnull((1)) dontthrow;
int __cxa_guard_acquire(union CxaGuardValue *) libcesque;
int __cxa_thread_atexit(void *, void *, void *) dontthrow; int __cxa_thread_atexit(void *, void *, void *) dontthrow;
void __cxa_finalize(void *); void __cxa_finalize(void *);
void __cxa_guard_abort(union CxaGuardValue *) dontthrow;
void __cxa_guard_release(union CxaGuardValue *) dontthrow; #ifdef __cplusplus
void __cxa_pure_virtual(void) wontreturn; } /* namespace __cxxabiv1 */
#endif /* __cplusplus */
COSMOPOLITAN_C_END_ COSMOPOLITAN_C_END_
#endif /* _CXXABI_H */ #endif /* _CXXABI_H */

View file

@ -1 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_CXXABI_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_CXXABI_H_
#include "third_party/libcxxabi/include/cxxabi.h"
#include "libc/cxxabi.h" #include "libc/cxxabi.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_CXXABI_H_ */