GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / toolchains / hndtools-arm-linux-2.6.36-uclibc-4.5.3 / arm-brcm-linux-uclibcgnueabi / include / c++ / 4.5.3 / exception_ptr.h
blob3ee4d8d327d49cba5a40f189ac6520645addd891
1 // Exception Handling support header (exception_ptr class) for -*- C++ -*-
3 // Copyright (C) 2008, 2009 Free Software Foundation
4 //
5 // This file is part of GCC.
6 //
7 // GCC is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 3, or (at your option)
10 // any later version.
11 //
12 // GCC is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // Under Section 7 of GPL version 3, you are granted additional
18 // permissions described in the GCC Runtime Library Exception, version
19 // 3.1, as published by the Free Software Foundation.
21 // You should have received a copy of the GNU General Public License and
22 // a copy of the GCC Runtime Library Exception along with this program;
23 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 // <http://www.gnu.org/licenses/>.
26 /** @file exception_ptr.h
27 * This is an internal header file, included by other headers and the
28 * implementation. You should not attempt to use it directly.
31 #ifndef _EXCEPTION_PTR_H
32 #define _EXCEPTION_PTR_H
34 #pragma GCC visibility push(default)
36 #include <bits/c++config.h>
37 #include <exception_defines.h>
39 #if !defined(_GLIBCXX_ATOMIC_BUILTINS_4)
40 # error This platform does not support exception propagation.
41 #endif
43 extern "C++" {
45 namespace std
47 /**
48 * @addtogroup exceptions
49 * @{
51 namespace __exception_ptr
53 class exception_ptr;
56 using __exception_ptr::exception_ptr;
58 /** Obtain an exception_ptr to the currently handled exception. If there
59 * is none, or the currently handled exception is foreign, return the null
60 * value.
62 exception_ptr current_exception() throw();
64 /// Throw the object pointed to by the exception_ptr.
65 void rethrow_exception(exception_ptr) __attribute__ ((__noreturn__));
67 namespace __exception_ptr
69 /**
70 * @brief An opaque pointer to an arbitrary exception.
71 * @ingroup exceptions
73 class exception_ptr
75 void* _M_exception_object;
77 explicit exception_ptr(void* __e) throw();
79 void _M_addref() throw();
80 void _M_release() throw();
82 void *_M_get() const throw() __attribute__ ((__pure__));
84 void _M_safe_bool_dummy() throw() __attribute__ ((__const__));
86 friend exception_ptr std::current_exception() throw();
87 friend void std::rethrow_exception(exception_ptr);
89 public:
90 exception_ptr() throw();
92 typedef void (exception_ptr::*__safe_bool)();
94 // For construction from nullptr or 0.
95 exception_ptr(__safe_bool) throw();
97 exception_ptr(const exception_ptr&) throw();
99 #ifdef __GXX_EXPERIMENTAL_CXX0X__
100 exception_ptr(exception_ptr&& __o) throw()
101 : _M_exception_object(__o._M_exception_object)
102 { __o._M_exception_object = 0; }
103 #endif
105 exception_ptr&
106 operator=(const exception_ptr&) throw();
108 #ifdef __GXX_EXPERIMENTAL_CXX0X__
109 exception_ptr&
110 operator=(exception_ptr&& __o) throw()
112 exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*this);
113 return *this;
115 #endif
117 ~exception_ptr() throw();
119 void
120 swap(exception_ptr&) throw();
122 #ifdef _GLIBCXX_EH_PTR_COMPAT
123 // Retained for compatibility with CXXABI_1.3.
124 bool operator!() const throw() __attribute__ ((__pure__));
125 operator __safe_bool() const throw();
126 #endif
128 friend bool
129 operator==(const exception_ptr&, const exception_ptr&) throw()
130 __attribute__ ((__pure__));
132 const type_info*
133 __cxa_exception_type() const throw() __attribute__ ((__pure__));
136 bool
137 operator==(const exception_ptr&, const exception_ptr&) throw()
138 __attribute__ ((__pure__));
140 bool
141 operator!=(const exception_ptr&, const exception_ptr&) throw()
142 __attribute__ ((__pure__));
143 } // namespace __exception_ptr
146 /// Obtain an exception_ptr pointing to a copy of the supplied object.
147 template<typename _Ex>
148 exception_ptr
149 copy_exception(_Ex __ex) throw()
151 __try
153 #ifdef __EXCEPTIONS
154 throw __ex;
155 #endif
157 __catch(...)
159 return current_exception();
163 // @} group exceptions
164 } // namespace std
166 } // extern "C++"
168 #pragma GCC visibility pop
170 #endif