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

Side by Side Diff: third_party/libcxx/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 unified diff | Download patch
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 //===------------------------- typeinfo.cpp -------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 #include <stdlib.h>
10
11 #ifndef __has_include
12 #define __has_include(inc) 0
13 #endif
14
15 #ifdef __APPLE__
16 #include <cxxabi.h>
17 #elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
18 #include <cxxabi.h>
19 #endif
20
21 #include "typeinfo"
22
23 #if !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION)
24
25 std::bad_cast::bad_cast() _NOEXCEPT
26 {
27 }
28
29 std::bad_typeid::bad_typeid() _NOEXCEPT
30 {
31 }
32
33 #ifndef __GLIBCXX__
34
35 std::bad_cast::~bad_cast() _NOEXCEPT
36 {
37 }
38
39 const char*
40 std::bad_cast::what() const _NOEXCEPT
41 {
42 return "std::bad_cast";
43 }
44
45 std::bad_typeid::~bad_typeid() _NOEXCEPT
46 {
47 }
48
49 const char*
50 std::bad_typeid::what() const _NOEXCEPT
51 {
52 return "std::bad_typeid";
53 }
54
55 #ifdef __APPLE__
56 // On Darwin, the cxa_bad_* functions cannot be in the lower level library
57 // because bad_cast and bad_typeid are defined in his higher level library
58 void __cxxabiv1::__cxa_bad_typeid()
59 {
60 #ifndef _LIBCPP_NO_EXCEPTIONS
61 throw std::bad_typeid();
62 #endif
63 }
64 void __cxxabiv1::__cxa_bad_cast()
65 {
66 #ifndef _LIBCPP_NO_EXCEPTIONS
67 throw std::bad_cast();
68 #endif
69 }
70 #endif
71
72 #endif // !__GLIBCXX__
73 #endif // !LIBCXXRT && !_LIBCPPABI_VERSION
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698