From 12e54665142c771a43f9365474254232764442f6 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Tue, 5 Apr 2022 02:23:06 -0700 Subject: [PATCH] Support `-fno-exceptions` --- src/alloc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index cd4afa1e..2c2a5840 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -802,9 +802,11 @@ static bool mi_try_new_handler(bool nothrow) { #endif if (h==NULL) { _mi_error_message(ENOMEM, "out of memory in 'new'"); - if (!nothrow) { +#ifdef __EXCEPTIONS throw std::bad_alloc(); - } +#else + abort(); +#endif return false; } else {