From 7e223f5726710eb28175eb795cf909b8f1a838f6 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Thu, 1 May 2025 00:19:18 +0000 Subject: [PATCH] Add downstream library changes from emscripten This reflects up-to-date Emscripten library changes to emscripten-lib-19 branch. --- libcxx/include/__locale_dir/locale_base_api.h | 6 +++--- libcxxabi/src/cxa_exception.cpp | 4 ++-- libcxxabi/src/private_typeinfo.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libcxx/include/__locale_dir/locale_base_api.h b/libcxx/include/__locale_dir/locale_base_api.h index 8c000c558c527..242441e22b7f5 100644 --- a/libcxx/include/__locale_dir/locale_base_api.h +++ b/libcxx/include/__locale_dir/locale_base_api.h @@ -9,7 +9,9 @@ #ifndef _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_H #define _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_H -#if defined(_LIBCPP_MSVCRT_LIKE) +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) +# include +#elif defined(_LIBCPP_MSVCRT_LIKE) # include <__locale_dir/locale_base_api/win32.h> #elif defined(_AIX) || defined(__MVS__) # include <__locale_dir/locale_base_api/ibm.h> @@ -25,8 +27,6 @@ # include <__locale_dir/locale_base_api/fuchsia.h> #elif defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC) # include <__locale_dir/locale_base_api/musl.h> -#elif defined(__APPLE__) || defined(__FreeBSD__) -# include #endif #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxxabi/src/cxa_exception.cpp b/libcxxabi/src/cxa_exception.cpp index 06dd9a8f2b375..4b82d0bf066ee 100644 --- a/libcxxabi/src/cxa_exception.cpp +++ b/libcxxabi/src/cxa_exception.cpp @@ -789,9 +789,9 @@ __cxa_rethrow_primary_exception(void* thrown_object) // In debug mode, call a JS library function to use // WebAssembly.Exception JS API, which enables us to include stack // traces - __throw_exception_with_stack_trace(&exception_header->unwindHeader); + __throw_exception_with_stack_trace(&dep_exception_header->unwindHeader); #else - _Unwind_RaiseException(&exception_header->unwindHeader); + _Unwind_RaiseException(&dep_exception_header->unwindHeader); #endif // Some sort of unwinding error. Note that terminate is a handler. __cxa_begin_catch(&dep_exception_header->unwindHeader); diff --git a/libcxxabi/src/private_typeinfo.cpp b/libcxxabi/src/private_typeinfo.cpp index 96a8cd09bfdab..0004f773f9248 100644 --- a/libcxxabi/src/private_typeinfo.cpp +++ b/libcxxabi/src/private_typeinfo.cpp @@ -1546,7 +1546,7 @@ __base_class_type_info::search_below_dst(__dynamic_cast_info* info, // XXX EMSCRIPTEN -#ifndef __WASM_EXCEPTIONS__ +#if defined(__wasm__) && !defined(__WASM_EXCEPTIONS__) #include "cxa_exception.h" @@ -1601,5 +1601,5 @@ void *__cxa_get_exception_ptr(void *thrown_object) throw() { } // __cxxabiv1 -#endif // !__WASM_EXCEPTIONS__ +#endif // __wasm__ && !__WASM_EXCEPTIONS__