diff options
author | theraven <theraven@FreeBSD.org> | 2011-11-22 17:30:41 +0000 |
---|---|---|
committer | theraven <theraven@FreeBSD.org> | 2011-11-22 17:30:41 +0000 |
commit | d8f28ec8a2faabad3aabb9f7a26755971424ef05 (patch) | |
tree | 5c73f10d9b3740138364680a74334d50b222cd6d /src/typeinfo.cpp | |
download | FreeBSD-src-d8f28ec8a2faabad3aabb9f7a26755971424ef05.zip FreeBSD-src-d8f28ec8a2faabad3aabb9f7a26755971424ef05.tar.gz |
Import libcxxrt / libc++ into a vendor branch.
Approved by: dim (mentor)
Diffstat (limited to 'src/typeinfo.cpp')
-rw-r--r-- | src/typeinfo.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/typeinfo.cpp b/src/typeinfo.cpp new file mode 100644 index 0000000..9ca03a1 --- /dev/null +++ b/src/typeinfo.cpp @@ -0,0 +1,50 @@ +//===------------------------- typeinfo.cpp -------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// +#include <stdlib.h> +#if __APPLE__ +#include <cxxabi.h> +#endif + +#include "typeinfo" + +std::bad_cast::bad_cast() _NOEXCEPT +{ +} + +std::bad_cast::~bad_cast() _NOEXCEPT +{ +} + +const char* +std::bad_cast::what() const _NOEXCEPT +{ + return "std::bad_cast"; +} + +std::bad_typeid::bad_typeid() _NOEXCEPT +{ +} + +std::bad_typeid::~bad_typeid() _NOEXCEPT +{ +} + +const char* +std::bad_typeid::what() const _NOEXCEPT +{ + return "std::bad_typeid"; +} + +#if __APPLE__ + // On Darwin, the cxa_bad_* functions cannot be in the lower level library + // because bad_cast and bad_typeid are defined in his higher level library + void __cxxabiv1::__cxa_bad_typeid() { throw std::bad_typeid(); } + void __cxxabiv1::__cxa_bad_cast() { throw std::bad_cast(); } +#endif + |