mirror-llvm-project/libcxx/include/__exception
Stephan T. Lavavej 9e13720eb8
[libc++] Add MSVC's implementation of exception_ptr for Windows (#94977)
Microsoft is happy to contribute our implementation of exception_ptr for
Windows, under the Apache License v2.0 with LLVM Exception that our STLs
share.

* excptptr.cpp, copied verbatim as:
e36ee6c2b9/stl/src/excptptr.cpp
* <exception>, copied verbatim as:
e36ee6c2b9/stl/inc/exception

The implementation was integrated into libc++:
* Deleted STL copy of <exception>. All standard exception classes are
  already provided by libc++'s standard headers.
* Replaced MSVC STL naming conventions and macros (_STD,
  _CRTIMP2_PURE, _Ref_count_base, _Ptr_base, _EXCEPTION_RECORD, etc.)
  with standard libc++ style and identifiers (_LIBCPP_EXPORTED_FROM_ABI,
  __double_leading_underscore variable/function names).
* Replaced internal MSVC CRT headers (<trnsctrl.h>,
  <internal_shared.h>, <xcall_once.h>) with portable standard C++
  constructs (e.g., standard C++ function-local static initialization
  for immortal static exception objects) and inline pointer-to-member
  invocation helpers.
* Removed all exported __ExceptionPtr... C functions. These symbols
  were originally present in Microsoft's CRT DLL exports solely to
  support inline methods in MSVC STL's <exception> header.
* Moved all SEH/EH exception record definitions, SEH copying helpers
  (__populate_cpp_exception_record, __copy_exception_object), and
  reference-counted control blocks (__exception_ptr_static and
  __exception_ptr_normal) directly into exception_pointer_msvc.ipp.
* Use reference-counted control block representation on Windows which
  removed the platform #ifdef _LIBCPP_ABI_MICROSOFT bifurcation for
  class exception_ptr in exception_ptr.h. std::exception_ptr now uses
  the same layout across all operating systems.

Co-authored-by: Petr Hosek <phosek@google.com>
2026-07-10 11:26:24 -07:00
..
exception.h [libc++] Introduce implicit and explicit ABI annotations (#193045) 2026-05-08 12:21:31 +02:00
exception_ptr.h [libc++] Add MSVC's implementation of exception_ptr for Windows (#94977) 2026-07-10 11:26:24 -07:00
nested_exception.h [libc++] Make __can_dynamic_cast a variable template (#202297) 2026-06-09 08:23:08 +02:00
operations.h [libc++] Introduce implicit and explicit ABI annotations (#193045) 2026-05-08 12:21:31 +02:00
terminate.h [libc++] Introduce implicit and explicit ABI annotations (#193045) 2026-05-08 12:21:31 +02:00