@@ -9,8 +9,10 @@ | |||
#include <deque> | |||
#include <mutex> | |||
#include <map> | |||
#include <list> | |||
#include <unordered_map> | |||
#include <optional> | |||
#include <thread> | |||
#include <assert.h> | |||
@@ -26,6 +26,9 @@ namespace resumef | |||
suspend_on_initial initial_suspend() noexcept; | |||
suspend_on_final final_suspend() noexcept; | |||
void set_exception(std::exception_ptr e); | |||
#ifdef __clang__ | |||
void unhandled_exception(); | |||
#endif | |||
future_type get_return_object(); | |||
void cancellation_requested(); | |||
}; |
@@ -60,6 +60,14 @@ namespace resumef | |||
_state->set_exception(std::move(e)); | |||
} | |||
#ifdef __clang__ | |||
template <typename _Ty> | |||
inline void promise_impl_t<_Ty>::unhandled_exception() | |||
{ | |||
std::terminate(); | |||
} | |||
#endif | |||
template <typename _Ty> | |||
inline future_t<_Ty> promise_impl_t<_Ty>::get_return_object() | |||
{ |
@@ -27,6 +27,9 @@ namespace resumef | |||
{ | |||
if (classname) | |||
{ | |||
#if __clang__ | |||
#define sprintf_s sprintf | |||
#endif | |||
sprintf_s(sz_future_error_buffer, "%s, code=%s", classname, future_error_string[(size_t)(fe)]); | |||
return sz_future_error_buffer; | |||
} |