41-exception.patch 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. diff --git a/include/__exception/exception_ptr.h b/include/__exception/exception_ptr.h
  2. index 970d819..03d3843 100644
  3. --- a/include/__exception/exception_ptr.h
  4. +++ b/include/__exception/exception_ptr.h
  5. @@ -21,7 +21,6 @@
  6. namespace std { // purposefully not using versioning namespace
  7. -#ifndef _LIBCPP_ABI_MICROSOFT
  8. class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {
  9. void* __ptr_;
  10. @@ -44,10 +43,19 @@ public:
  11. return !(__x == __y);
  12. }
  13. + friend _LIBCPP_HIDE_FROM_ABI void swap(exception_ptr& __x, exception_ptr& __y) _NOEXCEPT
  14. + {
  15. + void* __tmp = __x.__ptr_;
  16. + __x.__ptr_ = __y.__ptr_;
  17. + __y.__ptr_ = __tmp;
  18. + }
  19. +
  20. friend _LIBCPP_EXPORTED_FROM_ABI exception_ptr current_exception() _NOEXCEPT;
  21. friend _LIBCPP_EXPORTED_FROM_ABI void rethrow_exception(exception_ptr);
  22. };
  23. +#ifndef _LIBCPP_ABI_MICROSOFT
  24. +
  25. template <class _Ep>
  26. _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
  27. # ifndef _LIBCPP_HAS_NO_EXCEPTIONS
  28. @@ -64,34 +72,7 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
  29. #else // _LIBCPP_ABI_MICROSOFT
  30. -class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {
  31. - _LIBCPP_DIAGNOSTIC_PUSH
  32. - _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wunused-private-field")
  33. - void* __ptr1_;
  34. - void* __ptr2_;
  35. - _LIBCPP_DIAGNOSTIC_POP
  36. -
  37. -public:
  38. - exception_ptr() _NOEXCEPT;
  39. - exception_ptr(nullptr_t) _NOEXCEPT;
  40. - exception_ptr(const exception_ptr& __other) _NOEXCEPT;
  41. - exception_ptr& operator=(const exception_ptr& __other) _NOEXCEPT;
  42. - exception_ptr& operator=(nullptr_t) _NOEXCEPT;
  43. - ~exception_ptr() _NOEXCEPT;
  44. - explicit operator bool() const _NOEXCEPT;
  45. -};
  46. -
  47. -_LIBCPP_EXPORTED_FROM_ABI bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT;
  48. -
  49. -inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT {
  50. - return !(__x == __y);
  51. -}
  52. -
  53. -_LIBCPP_EXPORTED_FROM_ABI void swap(exception_ptr&, exception_ptr&) _NOEXCEPT;
  54. -
  55. -_LIBCPP_EXPORTED_FROM_ABI exception_ptr __copy_exception_ptr(void* __except, const void* __ptr);
  56. -_LIBCPP_EXPORTED_FROM_ABI exception_ptr current_exception() _NOEXCEPT;
  57. -_LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void rethrow_exception(exception_ptr);
  58. +_LIBCPP_HIDE_FROM_ABI exception_ptr __copy_exception_ptr(void *__exception, const void* __ptr);
  59. // This is a built-in template function which automagically extracts the required
  60. // information.
  61. @@ -99,7 +80,7 @@ template <class _E>
  62. void* __GetExceptionInfo(_E);
  63. template <class _Ep>
  64. -_LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
  65. +exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
  66. return __copy_exception_ptr(std::addressof(__e), __GetExceptionInfo(__e));
  67. }