mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-06 16:40:47 +00:00
Tentatively apply https://github.com/libcxxrt/libcxxrt/pull/27
This marks __cxa_allocate_exception, __cxa_free_exception and __cxa_init_primary_exception noexcept, to ensure compatibility with libc++'s declarations. PR: 276104 MFC after: 1 month
This commit is contained in:
parent
7a6dacaca1
commit
3fb2e04579
|
@ -204,12 +204,12 @@ __cxa_eh_globals *__cxa_get_globals_fast(void);
|
||||||
std::type_info * __cxa_current_exception_type();
|
std::type_info * __cxa_current_exception_type();
|
||||||
|
|
||||||
|
|
||||||
void *__cxa_allocate_exception(size_t thrown_size);
|
void *__cxa_allocate_exception(size_t thrown_size) throw();
|
||||||
|
|
||||||
void __cxa_free_exception(void* thrown_exception);
|
void __cxa_free_exception(void* thrown_exception) throw();
|
||||||
|
|
||||||
__cxa_exception *__cxa_init_primary_exception(
|
__cxa_exception *__cxa_init_primary_exception(
|
||||||
void *object, std::type_info* tinfo, void (*dest)(void *));
|
void *object, std::type_info* tinfo, void (*dest)(void *)) throw();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Throws an exception returned by __cxa_current_primary_exception(). This
|
* Throws an exception returned by __cxa_current_primary_exception(). This
|
||||||
|
|
|
@ -121,7 +121,7 @@ static inline _Unwind_Reason_Code continueUnwinding(struct _Unwind_Exception *ex
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern "C" void __cxa_free_exception(void *thrown_exception);
|
extern "C" void __cxa_free_exception(void *thrown_exception) throw();
|
||||||
extern "C" void __cxa_free_dependent_exception(void *thrown_exception);
|
extern "C" void __cxa_free_dependent_exception(void *thrown_exception);
|
||||||
extern "C" void* __dynamic_cast(const void *sub,
|
extern "C" void* __dynamic_cast(const void *sub,
|
||||||
const __class_type_info *src,
|
const __class_type_info *src,
|
||||||
|
@ -611,7 +611,7 @@ static void free_exception(char *e)
|
||||||
* emergency buffer if malloc() fails, and may block if there are no such
|
* emergency buffer if malloc() fails, and may block if there are no such
|
||||||
* buffers available.
|
* buffers available.
|
||||||
*/
|
*/
|
||||||
extern "C" void *__cxa_allocate_exception(size_t thrown_size)
|
extern "C" void *__cxa_allocate_exception(size_t thrown_size) throw()
|
||||||
{
|
{
|
||||||
size_t size = thrown_size + sizeof(__cxa_exception);
|
size_t size = thrown_size + sizeof(__cxa_exception);
|
||||||
char *buffer = alloc_or_die(size);
|
char *buffer = alloc_or_die(size);
|
||||||
|
@ -633,7 +633,7 @@ extern "C" void *__cxa_allocate_dependent_exception(void)
|
||||||
* In this implementation, it is also called by __cxa_end_catch() and during
|
* In this implementation, it is also called by __cxa_end_catch() and during
|
||||||
* thread cleanup.
|
* thread cleanup.
|
||||||
*/
|
*/
|
||||||
extern "C" void __cxa_free_exception(void *thrown_exception)
|
extern "C" void __cxa_free_exception(void *thrown_exception) throw()
|
||||||
{
|
{
|
||||||
__cxa_exception *ex = reinterpret_cast<__cxa_exception*>(thrown_exception) - 1;
|
__cxa_exception *ex = reinterpret_cast<__cxa_exception*>(thrown_exception) - 1;
|
||||||
// Free the object that was thrown, calling its destructor
|
// Free the object that was thrown, calling its destructor
|
||||||
|
@ -794,7 +794,7 @@ static void throw_exception(__cxa_exception *ex)
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" __cxa_exception *__cxa_init_primary_exception(
|
extern "C" __cxa_exception *__cxa_init_primary_exception(
|
||||||
void *object, std::type_info* tinfo, void (*dest)(void *)) {
|
void *object, std::type_info* tinfo, void (*dest)(void *)) throw() {
|
||||||
__cxa_exception *ex = reinterpret_cast<__cxa_exception*>(object) - 1;
|
__cxa_exception *ex = reinterpret_cast<__cxa_exception*>(object) - 1;
|
||||||
|
|
||||||
ex->referenceCount = 0;
|
ex->referenceCount = 0;
|
||||||
|
|
Loading…
Reference in a new issue