diff options
Diffstat (limited to 'contrib/libc++/src/support/runtime/exception_libcxxabi.ipp')
-rw-r--r-- | contrib/libc++/src/support/runtime/exception_libcxxabi.ipp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/contrib/libc++/src/support/runtime/exception_libcxxabi.ipp b/contrib/libc++/src/support/runtime/exception_libcxxabi.ipp new file mode 100644 index 0000000..c3dcf1e --- /dev/null +++ b/contrib/libc++/src/support/runtime/exception_libcxxabi.ipp @@ -0,0 +1,28 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPPABI_VERSION +#error this header can only be used with libc++abi +#endif + +namespace std { + +bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; } + +int uncaught_exceptions() _NOEXCEPT +{ +# if _LIBCPPABI_VERSION > 1101 + return __cxa_uncaught_exceptions(); +# else + return __cxa_uncaught_exception() ? 1 : 0; +# endif +} + +} // namespace std |