Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: third_party/libc++/src/typeinfo.cpp

Issue 75213003: Add libc++ and libc++abi to third-party. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libc++/src/thread.cpp ('k') | third_party/libc++/src/utility.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libc++/src/typeinfo.cpp
===================================================================
--- third_party/libc++/src/typeinfo.cpp (revision 0)
+++ third_party/libc++/src/typeinfo.cpp (revision 0)
@@ -0,0 +1,73 @@
+//===------------------------- 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>
+
+#ifndef __has_include
+#define __has_include(inc) 0
+#endif
+
+#ifdef __APPLE__
+#include <cxxabi.h>
+#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
+#include <cxxabi.h>
+#endif
+
+#include "typeinfo"
+
+#if !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION)
+
+std::bad_cast::bad_cast() _NOEXCEPT
+{
+}
+
+std::bad_typeid::bad_typeid() _NOEXCEPT
+{
+}
+
+#ifndef __GLIBCXX__
+
+std::bad_cast::~bad_cast() _NOEXCEPT
+{
+}
+
+const char*
+std::bad_cast::what() const _NOEXCEPT
+{
+ return "std::bad_cast";
+}
+
+std::bad_typeid::~bad_typeid() _NOEXCEPT
+{
+}
+
+const char*
+std::bad_typeid::what() const _NOEXCEPT
+{
+ return "std::bad_typeid";
+}
+
+#ifdef __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()
+ {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw std::bad_typeid();
+#endif
+ }
+ void __cxxabiv1::__cxa_bad_cast()
+ {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw std::bad_cast();
+#endif
+ }
+#endif
+
+#endif // !__GLIBCXX__
+#endif // !LIBCXXRT && !_LIBCPPABI_VERSION
Property changes on: third_party/libc++/src/typeinfo.cpp
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « third_party/libc++/src/thread.cpp ('k') | third_party/libc++/src/utility.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698