12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- diff --git a/include/__exception/exception_ptr.h b/include/__exception/exception_ptr.h
- index 53e2f71..73834b6 100644
- --- a/include/__exception/exception_ptr.h
- +++ b/include/__exception/exception_ptr.h
- @@ -36,11 +36,14 @@ struct __cxa_exception;
- _LIBCPP_OVERRIDABLE_FUNC_VIS __cxa_exception* __cxa_init_primary_exception(
- void*,
- std::type_info*,
- - void(
- # if defined(_WIN32)
- - __thiscall
- + void(__thiscall*)(void*)) throw();
- +# elif defined(__wasm__)
- + // In Wasm, a destructor returns its argument
- + void* (*)(void*)) throw();
- +# else
- + void (*)(void*)) throw();
- # endif
- - *)(void*)) throw();
- }
-
- } // namespace __cxxabiv1
- @@ -88,8 +91,16 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
- using _Ep2 = __decay_t<_Ep>;
-
- void* __ex = __cxxabiv1::__cxa_allocate_exception(sizeof(_Ep));
- +# ifdef __wasm__
- + // In Wasm, a destructor returns its argument
- + (void)__cxxabiv1::__cxa_init_primary_exception(__ex, const_cast<std::type_info*>(&typeid(_Ep)), [](void* __p) -> void* {
- +# else
- (void)__cxxabiv1::__cxa_init_primary_exception(__ex, const_cast<std::type_info*>(&typeid(_Ep)), [](void* __p) {
- +# endif
- std::__destroy_at(static_cast<_Ep2*>(__p));
- +# ifdef __wasm__
- + return __p;
- +# endif
- });
-
- try {
- diff --git a/include/__locale b/include/__locale
- index 2186db8..fa987cb 100644
- --- a/include/__locale
- +++ b/include/__locale
- @@ -344,12 +344,12 @@ public:
- static const mask __regex_word = 0x4000; // 0x8000 and 0x0100 and 0x00ff are used
- # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT
- # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA
- -#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__)
- +#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
- # ifdef __APPLE__
- typedef __uint32_t mask;
- # elif defined(__FreeBSD__)
- typedef unsigned long mask;
- -# elif defined(__EMSCRIPTEN__) || defined(__NetBSD__)
- +# elif defined(__NetBSD__)
- typedef unsigned short mask;
- # endif
- static const mask space = _CTYPE_S;
|