diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-05-07 01:04:55 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-05-07 01:04:55 +0000 |
commit | 15551efd432d797ce49c320ade8ab516d783491c (patch) | |
tree | 5ca73490b77bf70ff23f61e369e7d3c9a8955b30 /libcxx/include/exception | |
parent | 7fa7dc36fed383098cd20f2bb94480e9562f17cf (diff) | |
download | bcm5719-llvm-15551efd432d797ce49c320ade8ab516d783491c.tar.gz bcm5719-llvm-15551efd432d797ce49c320ade8ab516d783491c.zip |
Add <experimental/memory_resource>
Reviewers: mclow.lists, EricWF
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20007
llvm-svn: 268829
Diffstat (limited to 'libcxx/include/exception')
-rw-r--r-- | libcxx/include/exception | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libcxx/include/exception b/libcxx/include/exception index 686e4ecd057..537e4e3f7b6 100644 --- a/libcxx/include/exception +++ b/libcxx/include/exception @@ -80,6 +80,10 @@ template <class E> void rethrow_if_nested(const E& e); #include <__config> #include <cstddef> #include <type_traits> +#if defined(_LIBCPP_HAS_NO_EXCEPTIONS) +#include <cstdio> +#include <cstdlib> +#endif #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -251,4 +255,19 @@ rethrow_if_nested(const _Ep&, typename enable_if< } // std +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Exception> +_LIBCPP_INLINE_VISIBILITY +inline void __libcpp_throw(_Exception const& __e) { +#ifndef _LIBCPP_HAS_NO_EXCEPTIONS + throw __e; +#else + _VSTD::fprintf(stderr, "%s\n", __e.what()); + _VSTD::abort(); +#endif +} + +_LIBCPP_END_NAMESPACE_STD + #endif // _LIBCPP_EXCEPTION |