Eric Fiselier | d22c9dc | 2017-02-10 08:57:35 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
| 2 | //===----------------------------------------------------------------------===// |
| 3 | // |
| 4 | // The LLVM Compiler Infrastructure |
| 5 | // |
| 6 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 7 | // Source Licenses. See LICENSE.TXT for details. |
| 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | |
| 11 | #ifndef _LIBCPPABI_VERSION |
| 12 | #error this header can only be used with libc++abi |
| 13 | #endif |
| 14 | |
| 15 | namespace std { |
| 16 | |
| 17 | bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; } |
| 18 | |
| 19 | int uncaught_exceptions() _NOEXCEPT |
| 20 | { |
| 21 | # if _LIBCPPABI_VERSION > 1101 |
| 22 | return __cxa_uncaught_exceptions(); |
| 23 | # else |
| 24 | return __cxa_uncaught_exception() ? 1 : 0; |
| 25 | # endif |
| 26 | } |
| 27 | |
| 28 | } // namespace std |