Support -fno-exceptions

This commit is contained in:
Jarred Sumner 2022-04-05 02:23:06 -07:00
parent 817569dfad
commit 12e5466514

View file

@ -802,9 +802,11 @@ static bool mi_try_new_handler(bool nothrow) {
#endif #endif
if (h==NULL) { if (h==NULL) {
_mi_error_message(ENOMEM, "out of memory in 'new'"); _mi_error_message(ENOMEM, "out of memory in 'new'");
if (!nothrow) { #ifdef __EXCEPTIONS
throw std::bad_alloc(); throw std::bad_alloc();
} #else
abort();
#endif
return false; return false;
} }
else { else {