diff --git a/include/gsl/gsl_assert b/include/gsl/gsl_assert index 131fa8b..be4676b 100644 --- a/include/gsl/gsl_assert +++ b/include/gsl/gsl_assert @@ -26,6 +26,8 @@ // #if defined(_MSC_VER) && defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS #define GSL_MSVC_USE_STL_NOEXCEPTION_WORKAROUND +#include +#define RANGE_CHECKS_FAILURE 0 #endif // @@ -82,10 +84,15 @@ namespace details #if defined(GSL_MSVC_USE_STL_NOEXCEPTION_WORKAROUND) typedef void (__cdecl *terminate_handler)(); + + [[noreturn]] inline void __cdecl default_terminate_handler() + { + __fastfail(RANGE_CHECKS_FAILURE); + } inline gsl::details::terminate_handler& get_terminate_handler() noexcept { - static terminate_handler handler = &abort; + static terminate_handler handler = &default_terminate_handler; return handler; }