diff options
Diffstat (limited to 'libcxx/src/stdexcept.cpp')
-rw-r--r-- | libcxx/src/stdexcept.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libcxx/src/stdexcept.cpp b/libcxx/src/stdexcept.cpp index d5c9173..bc25c0f 100644 --- a/libcxx/src/stdexcept.cpp +++ b/libcxx/src/stdexcept.cpp @@ -6,12 +6,25 @@ // //===----------------------------------------------------------------------===// +#include <__verbose_abort> #include <new> #include <stdexcept> #include <string> #ifdef _LIBCPP_ABI_VCRUNTIME -#include "support/runtime/stdexcept_vcruntime.ipp" +# include "support/runtime/stdexcept_vcruntime.ipp" #else -#include "support/runtime/stdexcept_default.ipp" +# include "support/runtime/stdexcept_default.ipp" #endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +_LIBCPP_NORETURN void __throw_runtime_error(const char* msg) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + throw runtime_error(msg); +#else + _LIBCPP_VERBOSE_ABORT("runtime_error was thrown in -fno-exceptions mode with message \"%s\"", msg); +#endif +} + +_LIBCPP_END_NAMESPACE_STD |