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>