brintos

brintos / llvm-project-archived public Read only

0
0
Text · 802 B · c42bb23 Raw
31 lines · plain
1// -*- C++ -*-2//===----------------------------------------------------------------------===//3//4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5// See https://llvm.org/LICENSE.txt for license information.6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7//8//===----------------------------------------------------------------------===//9 10#include <exception>11 12#include <cxxabi.h>13 14#ifndef _LIBCPPABI_VERSION15#  error this header can only be used with libc++abi16#endif17 18namespace std {19 20bool uncaught_exception() noexcept { return uncaught_exceptions() > 0; }21 22int uncaught_exceptions() noexcept {23#if _LIBCPPABI_VERSION > 100124  return abi::__cxa_uncaught_exceptions();25#else26  return abi::__cxa_uncaught_exception() ? 1 : 0;27#endif28}29 30} // namespace std31