no_except.patch 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. diff --git a/thirdparty/mingw-std-threads/mingw.condition_variable.h b/thirdparty/mingw-std-threads/mingw.condition_variable.h
  2. index 50c5ebd6df..f9e248c154 100644
  3. --- a/thirdparty/mingw-std-threads/mingw.condition_variable.h
  4. +++ b/thirdparty/mingw-std-threads/mingw.condition_variable.h
  5. @@ -87,12 +87,12 @@ public:
  6. : mSemaphore(CreateSemaphoreA(NULL, 0, 0xFFFF, NULL))
  7. {
  8. if (mSemaphore == NULL)
  9. - throw std::system_error(GetLastError(), std::generic_category());
  10. + __builtin_trap();
  11. mWakeEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
  12. if (mWakeEvent == NULL)
  13. {
  14. CloseHandle(mSemaphore);
  15. - throw std::system_error(GetLastError(), std::generic_category());
  16. + __builtin_trap();
  17. }
  18. }
  19. ~condition_variable_any()
  20. @@ -132,7 +132,7 @@ private:
  21. else
  22. {
  23. using namespace std;
  24. - throw system_error(make_error_code(errc::protocol_error));
  25. + __builtin_trap();
  26. }
  27. }
  28. public:
  29. diff --git a/thirdparty/mingw-std-threads/mingw.mutex.h b/thirdparty/mingw-std-threads/mingw.mutex.h
  30. index 03efa13f8b..73698d13cb 100644
  31. --- a/thirdparty/mingw-std-threads/mingw.mutex.h
  32. +++ b/thirdparty/mingw-std-threads/mingw.mutex.h
  33. @@ -132,7 +132,7 @@ struct _OwnerThread
  34. fprintf(stderr, "FATAL: Recursive locking of non-recursive mutex\
  35. detected. Throwing system exception\n");
  36. fflush(stderr);
  37. - throw system_error(make_error_code(errc::resource_deadlock_would_occur));
  38. + __builtin_trap();
  39. }
  40. DWORD checkOwnerBeforeLock() const
  41. {
  42. @@ -364,13 +364,13 @@ public:
  43. #endif
  44. if ((ret != kWaitObject0) && (ret != kWaitAbandoned))
  45. {
  46. - throw std::system_error(GetLastError(), std::system_category());
  47. + __builtin_trap();
  48. }
  49. }
  50. void unlock()
  51. {
  52. if (!ReleaseMutex(mHandle))
  53. - throw std::system_error(GetLastError(), std::system_category());
  54. + __builtin_trap();
  55. }
  56. bool try_lock()
  57. {
  58. diff --git a/thirdparty/mingw-std-threads/mingw.shared_mutex.h b/thirdparty/mingw-std-threads/mingw.shared_mutex.h
  59. index ff1ac65135..5375b0fbd1 100644
  60. --- a/thirdparty/mingw-std-threads/mingw.shared_mutex.h
  61. +++ b/thirdparty/mingw-std-threads/mingw.shared_mutex.h
  62. @@ -134,7 +134,7 @@ public:
  63. using namespace std;
  64. #ifndef NDEBUG
  65. if (!(mCounter.fetch_sub(1, memory_order_release) & static_cast<counter_type>(~kWriteBit)))
  66. - throw system_error(make_error_code(errc::operation_not_permitted));
  67. + __builtin_trap();
  68. #else
  69. mCounter.fetch_sub(1, memory_order_release);
  70. #endif
  71. @@ -187,7 +187,7 @@ public:
  72. using namespace std;
  73. #ifndef NDEBUG
  74. if (mCounter.load(memory_order_relaxed) != kWriteBit)
  75. - throw system_error(make_error_code(errc::operation_not_permitted));
  76. + __builtin_trap();
  77. #endif
  78. mCounter.store(0, memory_order_release);
  79. }
  80. @@ -317,9 +317,9 @@ class shared_lock
  81. {
  82. using namespace std;
  83. if (mMutex == nullptr)
  84. - throw system_error(make_error_code(errc::operation_not_permitted));
  85. + __builtin_trap();
  86. if (mOwns)
  87. - throw system_error(make_error_code(errc::resource_deadlock_would_occur));
  88. + __builtin_trap();
  89. }
  90. public:
  91. typedef Mutex mutex_type;
  92. @@ -432,7 +432,7 @@ public:
  93. {
  94. using namespace std;
  95. if (!mOwns)
  96. - throw system_error(make_error_code(errc::operation_not_permitted));
  97. + __builtin_trap();
  98. mMutex->unlock_shared();
  99. mOwns = false;
  100. }
  101. diff --git a/thirdparty/mingw-std-threads/mingw.thread.h b/thirdparty/mingw-std-threads/mingw.thread.h
  102. index bcdd1a36a8..7ca09e25f5 100644
  103. --- a/thirdparty/mingw-std-threads/mingw.thread.h
  104. +++ b/thirdparty/mingw-std-threads/mingw.thread.h
  105. @@ -196,7 +196,7 @@ public:
  106. int errnum = errno;
  107. delete call;
  108. // Note: Should only throw EINVAL, EAGAIN, EACCES
  109. - throw std::system_error(errnum, std::generic_category());
  110. + __builtin_trap();
  111. } else {
  112. mThreadId.mId = id_receiver;
  113. mHandle = reinterpret_cast<HANDLE>(int_handle);
  114. @@ -213,11 +213,11 @@ public:
  115. {
  116. using namespace std;
  117. if (get_id() == id(GetCurrentThreadId()))
  118. - throw system_error(make_error_code(errc::resource_deadlock_would_occur));
  119. + __builtin_trap();
  120. if (mHandle == kInvalidHandle)
  121. - throw system_error(make_error_code(errc::no_such_process));
  122. + __builtin_trap();
  123. if (!joinable())
  124. - throw system_error(make_error_code(errc::invalid_argument));
  125. + __builtin_trap();
  126. WaitForSingleObject(mHandle, kInfinite);
  127. CloseHandle(mHandle);
  128. mHandle = kInvalidHandle;
  129. @@ -266,7 +266,7 @@ moving another thread to it.\n");
  130. if (!joinable())
  131. {
  132. using namespace std;
  133. - throw system_error(make_error_code(errc::invalid_argument));
  134. + __builtin_trap();
  135. }
  136. if (mHandle != kInvalidHandle)
  137. {