libstdc++
|
00001 // ABI Support -*- C++ -*- 00002 00003 // Copyright (C) 2000-2017 Free Software Foundation, Inc. 00004 // 00005 // This file is part of GCC. 00006 // 00007 // GCC is free software; you can redistribute it and/or modify 00008 // it under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation; either version 3, or (at your option) 00010 // any later version. 00011 // 00012 // GCC is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // Under Section 7 of GPL version 3, you are granted additional 00018 // permissions described in the GCC Runtime Library Exception, version 00019 // 3.1, as published by the Free Software Foundation. 00020 00021 // You should have received a copy of the GNU General Public License and 00022 // a copy of the GCC Runtime Library Exception along with this program; 00023 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 00024 // <http://www.gnu.org/licenses/>. 00025 00026 // Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com> 00027 00028 /* This file declares the new abi entry points into the runtime. It is not 00029 normally necessary for user programs to include this header, or use the 00030 entry points directly. However, this header is available should that be 00031 needed. 00032 00033 Some of the entry points are intended for both C and C++, thus this header 00034 is includable from both C and C++. Though the C++ specific parts are not 00035 available in C, naturally enough. */ 00036 00037 /** @file cxxabi.h 00038 * The header provides an interface to the C++ ABI. 00039 */ 00040 00041 #ifndef _CXXABI_H 00042 #define _CXXABI_H 1 00043 00044 #pragma GCC system_header 00045 00046 #pragma GCC visibility push(default) 00047 00048 #include <stddef.h> 00049 #include <bits/c++config.h> 00050 #include <bits/cxxabi_tweaks.h> 00051 #include <bits/cxxabi_forced.h> 00052 #include <bits/cxxabi_init_exception.h> 00053 00054 #ifdef __cplusplus 00055 namespace __cxxabiv1 00056 { 00057 extern "C" 00058 { 00059 #endif 00060 00061 typedef __cxa_cdtor_return_type (*__cxa_cdtor_type)(void *); 00062 00063 // Allocate array. 00064 void* 00065 __cxa_vec_new(size_t __element_count, size_t __element_size, 00066 size_t __padding_size, __cxa_cdtor_type __constructor, 00067 __cxa_cdtor_type __destructor); 00068 00069 void* 00070 __cxa_vec_new2(size_t __element_count, size_t __element_size, 00071 size_t __padding_size, __cxa_cdtor_type __constructor, 00072 __cxa_cdtor_type __destructor, void *(*__alloc) (size_t), 00073 void (*__dealloc) (void*)); 00074 00075 void* 00076 __cxa_vec_new3(size_t __element_count, size_t __element_size, 00077 size_t __padding_size, __cxa_cdtor_type __constructor, 00078 __cxa_cdtor_type __destructor, void *(*__alloc) (size_t), 00079 void (*__dealloc) (void*, size_t)); 00080 00081 // Construct array. 00082 __cxa_vec_ctor_return_type 00083 __cxa_vec_ctor(void* __array_address, size_t __element_count, 00084 size_t __element_size, __cxa_cdtor_type __constructor, 00085 __cxa_cdtor_type __destructor); 00086 00087 __cxa_vec_ctor_return_type 00088 __cxa_vec_cctor(void* __dest_array, void* __src_array, 00089 size_t __element_count, size_t __element_size, 00090 __cxa_cdtor_return_type (*__constructor) (void*, void*), 00091 __cxa_cdtor_type __destructor); 00092 00093 // Destruct array. 00094 void 00095 __cxa_vec_dtor(void* __array_address, size_t __element_count, 00096 size_t __element_size, __cxa_cdtor_type __destructor); 00097 00098 void 00099 __cxa_vec_cleanup(void* __array_address, size_t __element_count, size_t __s, 00100 __cxa_cdtor_type __destructor) _GLIBCXX_NOTHROW; 00101 00102 // Destruct and release array. 00103 void 00104 __cxa_vec_delete(void* __array_address, size_t __element_size, 00105 size_t __padding_size, __cxa_cdtor_type __destructor); 00106 00107 void 00108 __cxa_vec_delete2(void* __array_address, size_t __element_size, 00109 size_t __padding_size, __cxa_cdtor_type __destructor, 00110 void (*__dealloc) (void*)); 00111 00112 void 00113 __cxa_vec_delete3(void* __array_address, size_t __element_size, 00114 size_t __padding_size, __cxa_cdtor_type __destructor, 00115 void (*__dealloc) (void*, size_t)); 00116 00117 int 00118 __cxa_guard_acquire(__guard*); 00119 00120 void 00121 __cxa_guard_release(__guard*) _GLIBCXX_NOTHROW; 00122 00123 void 00124 __cxa_guard_abort(__guard*) _GLIBCXX_NOTHROW; 00125 00126 // DSO destruction. 00127 int 00128 __cxa_atexit(void (*)(void*), void*, void*) _GLIBCXX_NOTHROW; 00129 00130 int 00131 __cxa_finalize(void*); 00132 00133 // TLS destruction. 00134 int 00135 __cxa_thread_atexit(void (*)(void*), void*, void *) _GLIBCXX_NOTHROW; 00136 00137 // Pure virtual functions. 00138 void 00139 __cxa_pure_virtual(void) __attribute__ ((__noreturn__)); 00140 00141 void 00142 __cxa_deleted_virtual(void) __attribute__ ((__noreturn__)); 00143 00144 // Exception handling auxiliary. 00145 void 00146 __cxa_bad_cast() __attribute__((__noreturn__)); 00147 00148 void 00149 __cxa_bad_typeid() __attribute__((__noreturn__)); 00150 00151 void 00152 __cxa_throw_bad_array_new_length() __attribute__((__noreturn__)); 00153 00154 /** 00155 * @brief Demangling routine. 00156 * ABI-mandated entry point in the C++ runtime library for demangling. 00157 * 00158 * @param __mangled_name A NUL-terminated character string 00159 * containing the name to be demangled. 00160 * 00161 * @param __output_buffer A region of memory, allocated with 00162 * malloc, of @a *__length bytes, into which the demangled name is 00163 * stored. If @a __output_buffer is not long enough, it is 00164 * expanded using realloc. @a __output_buffer may instead be NULL; 00165 * in that case, the demangled name is placed in a region of memory 00166 * allocated with malloc. 00167 * 00168 * @param __length If @a __length is non-NULL, the length of the 00169 * buffer containing the demangled name is placed in @a *__length. 00170 * 00171 * @param __status @a *__status is set to one of the following values: 00172 * 0: The demangling operation succeeded. 00173 * -1: A memory allocation failure occurred. 00174 * -2: @a mangled_name is not a valid name under the C++ ABI mangling rules. 00175 * -3: One of the arguments is invalid. 00176 * 00177 * @return A pointer to the start of the NUL-terminated demangled 00178 * name, or NULL if the demangling fails. The caller is 00179 * responsible for deallocating this memory using @c free. 00180 * 00181 * The demangling is performed using the C++ ABI mangling rules, 00182 * with GNU extensions. For example, this function is used in 00183 * __gnu_cxx::__verbose_terminate_handler. 00184 * 00185 * See https://gcc.gnu.org/onlinedocs/libstdc++/manual/ext_demangling.html 00186 * for other examples of use. 00187 * 00188 * @note The same demangling functionality is available via 00189 * libiberty (@c <libiberty/demangle.h> and @c libiberty.a) in GCC 00190 * 3.1 and later, but that requires explicit installation (@c 00191 * --enable-install-libiberty) and uses a different API, although 00192 * the ABI is unchanged. 00193 */ 00194 char* 00195 __cxa_demangle(const char* __mangled_name, char* __output_buffer, 00196 size_t* __length, int* __status); 00197 00198 #ifdef __cplusplus 00199 } 00200 } // namespace __cxxabiv1 00201 #endif 00202 00203 #ifdef __cplusplus 00204 00205 #include <typeinfo> 00206 00207 namespace __cxxabiv1 00208 { 00209 // Type information for int, float etc. 00210 class __fundamental_type_info : public std::type_info 00211 { 00212 public: 00213 explicit 00214 __fundamental_type_info(const char* __n) : std::type_info(__n) { } 00215 00216 virtual 00217 ~__fundamental_type_info(); 00218 }; 00219 00220 // Type information for array objects. 00221 class __array_type_info : public std::type_info 00222 { 00223 public: 00224 explicit 00225 __array_type_info(const char* __n) : std::type_info(__n) { } 00226 00227 virtual 00228 ~__array_type_info(); 00229 }; 00230 00231 // Type information for functions (both member and non-member). 00232 class __function_type_info : public std::type_info 00233 { 00234 public: 00235 explicit 00236 __function_type_info(const char* __n) : std::type_info(__n) { } 00237 00238 virtual 00239 ~__function_type_info(); 00240 00241 protected: 00242 // Implementation defined member function. 00243 virtual bool 00244 __is_function_p() const; 00245 }; 00246 00247 // Type information for enumerations. 00248 class __enum_type_info : public std::type_info 00249 { 00250 public: 00251 explicit 00252 __enum_type_info(const char* __n) : std::type_info(__n) { } 00253 00254 virtual 00255 ~__enum_type_info(); 00256 }; 00257 00258 // Common type information for simple pointers and pointers to member. 00259 class __pbase_type_info : public std::type_info 00260 { 00261 public: 00262 unsigned int __flags; // Qualification of the target object. 00263 const std::type_info* __pointee; // Type of pointed to object. 00264 00265 explicit 00266 __pbase_type_info(const char* __n, int __quals, 00267 const std::type_info* __type) 00268 : std::type_info(__n), __flags(__quals), __pointee(__type) 00269 { } 00270 00271 virtual 00272 ~__pbase_type_info(); 00273 00274 // Implementation defined type. 00275 enum __masks 00276 { 00277 __const_mask = 0x1, 00278 __volatile_mask = 0x2, 00279 __restrict_mask = 0x4, 00280 __incomplete_mask = 0x8, 00281 __incomplete_class_mask = 0x10, 00282 __transaction_safe_mask = 0x20, 00283 __noexcept_mask = 0x40 00284 }; 00285 00286 protected: 00287 __pbase_type_info(const __pbase_type_info&); 00288 00289 __pbase_type_info& 00290 operator=(const __pbase_type_info&); 00291 00292 // Implementation defined member functions. 00293 virtual bool 00294 __do_catch(const std::type_info* __thr_type, void** __thr_obj, 00295 unsigned int __outer) const; 00296 00297 inline virtual bool 00298 __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj, 00299 unsigned __outer) const; 00300 }; 00301 00302 inline bool __pbase_type_info:: 00303 __pointer_catch (const __pbase_type_info *thrown_type, 00304 void **thr_obj, 00305 unsigned outer) const 00306 { 00307 return __pointee->__do_catch (thrown_type->__pointee, thr_obj, outer + 2); 00308 } 00309 00310 // Type information for simple pointers. 00311 class __pointer_type_info : public __pbase_type_info 00312 { 00313 public: 00314 explicit 00315 __pointer_type_info(const char* __n, int __quals, 00316 const std::type_info* __type) 00317 : __pbase_type_info (__n, __quals, __type) { } 00318 00319 00320 virtual 00321 ~__pointer_type_info(); 00322 00323 protected: 00324 // Implementation defined member functions. 00325 virtual bool 00326 __is_pointer_p() const; 00327 00328 virtual bool 00329 __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj, 00330 unsigned __outer) const; 00331 }; 00332 00333 class __class_type_info; 00334 00335 // Type information for a pointer to member variable. 00336 class __pointer_to_member_type_info : public __pbase_type_info 00337 { 00338 public: 00339 __class_type_info* __context; // Class of the member. 00340 00341 explicit 00342 __pointer_to_member_type_info(const char* __n, int __quals, 00343 const std::type_info* __type, 00344 __class_type_info* __klass) 00345 : __pbase_type_info(__n, __quals, __type), __context(__klass) { } 00346 00347 virtual 00348 ~__pointer_to_member_type_info(); 00349 00350 protected: 00351 __pointer_to_member_type_info(const __pointer_to_member_type_info&); 00352 00353 __pointer_to_member_type_info& 00354 operator=(const __pointer_to_member_type_info&); 00355 00356 // Implementation defined member function. 00357 virtual bool 00358 __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj, 00359 unsigned __outer) const; 00360 }; 00361 00362 // Helper class for __vmi_class_type. 00363 class __base_class_type_info 00364 { 00365 public: 00366 const __class_type_info* __base_type; // Base class type. 00367 #ifdef _GLIBCXX_LLP64 00368 long long __offset_flags; // Offset and info. 00369 #else 00370 long __offset_flags; // Offset and info. 00371 #endif 00372 00373 enum __offset_flags_masks 00374 { 00375 __virtual_mask = 0x1, 00376 __public_mask = 0x2, 00377 __hwm_bit = 2, 00378 __offset_shift = 8 // Bits to shift offset. 00379 }; 00380 00381 // Implementation defined member functions. 00382 bool 00383 __is_virtual_p() const 00384 { return __offset_flags & __virtual_mask; } 00385 00386 bool 00387 __is_public_p() const 00388 { return __offset_flags & __public_mask; } 00389 00390 ptrdiff_t 00391 __offset() const 00392 { 00393 // This shift, being of a signed type, is implementation 00394 // defined. GCC implements such shifts as arithmetic, which is 00395 // what we want. 00396 return static_cast<ptrdiff_t>(__offset_flags) >> __offset_shift; 00397 } 00398 }; 00399 00400 // Type information for a class. 00401 class __class_type_info : public std::type_info 00402 { 00403 public: 00404 explicit 00405 __class_type_info (const char *__n) : type_info(__n) { } 00406 00407 virtual 00408 ~__class_type_info (); 00409 00410 // Implementation defined types. 00411 // The type sub_kind tells us about how a base object is contained 00412 // within a derived object. We often do this lazily, hence the 00413 // UNKNOWN value. At other times we may use NOT_CONTAINED to mean 00414 // not publicly contained. 00415 enum __sub_kind 00416 { 00417 // We have no idea. 00418 __unknown = 0, 00419 00420 // Not contained within us (in some circumstances this might 00421 // mean not contained publicly) 00422 __not_contained, 00423 00424 // Contained ambiguously. 00425 __contained_ambig, 00426 00427 // Via a virtual path. 00428 __contained_virtual_mask = __base_class_type_info::__virtual_mask, 00429 00430 // Via a public path. 00431 __contained_public_mask = __base_class_type_info::__public_mask, 00432 00433 // Contained within us. 00434 __contained_mask = 1 << __base_class_type_info::__hwm_bit, 00435 00436 __contained_private = __contained_mask, 00437 __contained_public = __contained_mask | __contained_public_mask 00438 }; 00439 00440 struct __upcast_result; 00441 struct __dyncast_result; 00442 00443 protected: 00444 // Implementation defined member functions. 00445 virtual bool 00446 __do_upcast(const __class_type_info* __dst_type, void**__obj_ptr) const; 00447 00448 virtual bool 00449 __do_catch(const type_info* __thr_type, void** __thr_obj, 00450 unsigned __outer) const; 00451 00452 public: 00453 // Helper for upcast. See if DST is us, or one of our bases. 00454 // Return false if not found, true if found. 00455 virtual bool 00456 __do_upcast(const __class_type_info* __dst, const void* __obj, 00457 __upcast_result& __restrict __result) const; 00458 00459 // Indicate whether SRC_PTR of type SRC_TYPE is contained publicly 00460 // within OBJ_PTR. OBJ_PTR points to a base object of our type, 00461 // which is the destination type. SRC2DST indicates how SRC 00462 // objects might be contained within this type. If SRC_PTR is one 00463 // of our SRC_TYPE bases, indicate the virtuality. Returns 00464 // not_contained for non containment or private containment. 00465 inline __sub_kind 00466 __find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr, 00467 const __class_type_info* __src_type, 00468 const void* __src_ptr) const; 00469 00470 // Helper for dynamic cast. ACCESS_PATH gives the access from the 00471 // most derived object to this base. DST_TYPE indicates the 00472 // desired type we want. OBJ_PTR points to a base of our type 00473 // within the complete object. SRC_TYPE indicates the static type 00474 // started from and SRC_PTR points to that base within the most 00475 // derived object. Fill in RESULT with what we find. Return true 00476 // if we have located an ambiguous match. 00477 virtual bool 00478 __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path, 00479 const __class_type_info* __dst_type, const void* __obj_ptr, 00480 const __class_type_info* __src_type, const void* __src_ptr, 00481 __dyncast_result& __result) const; 00482 00483 // Helper for find_public_subobj. SRC2DST indicates how SRC_TYPE 00484 // bases are inherited by the type started from -- which is not 00485 // necessarily the current type. The current type will be a base 00486 // of the destination type. OBJ_PTR points to the current base. 00487 virtual __sub_kind 00488 __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr, 00489 const __class_type_info* __src_type, 00490 const void* __src_ptr) const; 00491 }; 00492 00493 // Type information for a class with a single non-virtual base. 00494 class __si_class_type_info : public __class_type_info 00495 { 00496 public: 00497 const __class_type_info* __base_type; 00498 00499 explicit 00500 __si_class_type_info(const char *__n, const __class_type_info *__base) 00501 : __class_type_info(__n), __base_type(__base) { } 00502 00503 virtual 00504 ~__si_class_type_info(); 00505 00506 protected: 00507 __si_class_type_info(const __si_class_type_info&); 00508 00509 __si_class_type_info& 00510 operator=(const __si_class_type_info&); 00511 00512 // Implementation defined member functions. 00513 virtual bool 00514 __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path, 00515 const __class_type_info* __dst_type, const void* __obj_ptr, 00516 const __class_type_info* __src_type, const void* __src_ptr, 00517 __dyncast_result& __result) const; 00518 00519 virtual __sub_kind 00520 __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr, 00521 const __class_type_info* __src_type, 00522 const void* __sub_ptr) const; 00523 00524 virtual bool 00525 __do_upcast(const __class_type_info*__dst, const void*__obj, 00526 __upcast_result& __restrict __result) const; 00527 }; 00528 00529 // Type information for a class with multiple and/or virtual bases. 00530 class __vmi_class_type_info : public __class_type_info 00531 { 00532 public: 00533 unsigned int __flags; // Details about the class hierarchy. 00534 unsigned int __base_count; // Number of direct bases. 00535 00536 // The array of bases uses the trailing array struct hack so this 00537 // class is not constructable with a normal constructor. It is 00538 // internally generated by the compiler. 00539 __base_class_type_info __base_info[1]; // Array of bases. 00540 00541 explicit 00542 __vmi_class_type_info(const char* __n, int ___flags) 00543 : __class_type_info(__n), __flags(___flags), __base_count(0) { } 00544 00545 virtual 00546 ~__vmi_class_type_info(); 00547 00548 // Implementation defined types. 00549 enum __flags_masks 00550 { 00551 __non_diamond_repeat_mask = 0x1, // Distinct instance of repeated base. 00552 __diamond_shaped_mask = 0x2, // Diamond shaped multiple inheritance. 00553 __flags_unknown_mask = 0x10 00554 }; 00555 00556 protected: 00557 // Implementation defined member functions. 00558 virtual bool 00559 __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path, 00560 const __class_type_info* __dst_type, const void* __obj_ptr, 00561 const __class_type_info* __src_type, const void* __src_ptr, 00562 __dyncast_result& __result) const; 00563 00564 virtual __sub_kind 00565 __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr, 00566 const __class_type_info* __src_type, 00567 const void* __src_ptr) const; 00568 00569 virtual bool 00570 __do_upcast(const __class_type_info* __dst, const void* __obj, 00571 __upcast_result& __restrict __result) const; 00572 }; 00573 00574 // Exception handling forward declarations. 00575 struct __cxa_exception; 00576 struct __cxa_refcounted_exception; 00577 struct __cxa_dependent_exception; 00578 struct __cxa_eh_globals; 00579 00580 extern "C" 00581 { 00582 // Dynamic cast runtime. 00583 00584 // src2dst has the following possible values 00585 // >-1: src_type is a unique public non-virtual base of dst_type 00586 // dst_ptr + src2dst == src_ptr 00587 // -1: unspecified relationship 00588 // -2: src_type is not a public base of dst_type 00589 // -3: src_type is a multiple public non-virtual base of dst_type 00590 void* 00591 __dynamic_cast(const void* __src_ptr, // Starting object. 00592 const __class_type_info* __src_type, // Static type of object. 00593 const __class_type_info* __dst_type, // Desired target type. 00594 ptrdiff_t __src2dst); // How src and dst are related. 00595 00596 00597 // Exception handling runtime. 00598 00599 // The __cxa_eh_globals for the current thread can be obtained by using 00600 // either of the following functions. The "fast" version assumes at least 00601 // one prior call of __cxa_get_globals has been made from the current 00602 // thread, so no initialization is necessary. 00603 __cxa_eh_globals* 00604 __cxa_get_globals() _GLIBCXX_NOTHROW __attribute__ ((__const__)); 00605 00606 __cxa_eh_globals* 00607 __cxa_get_globals_fast() _GLIBCXX_NOTHROW __attribute__ ((__const__)); 00608 00609 // Free the space allocated for the primary exception. 00610 void 00611 __cxa_free_exception(void*) _GLIBCXX_NOTHROW; 00612 00613 // Throw the exception. 00614 void 00615 __cxa_throw(void*, std::type_info*, void (_GLIBCXX_CDTOR_CALLABI *) (void *)) 00616 __attribute__((__noreturn__)); 00617 00618 // Used to implement exception handlers. 00619 void* 00620 __cxa_get_exception_ptr(void*) _GLIBCXX_NOTHROW __attribute__ ((__pure__)); 00621 00622 void* 00623 __cxa_begin_catch(void*) _GLIBCXX_NOTHROW; 00624 00625 void 00626 __cxa_end_catch(); 00627 00628 void 00629 __cxa_rethrow() __attribute__((__noreturn__)); 00630 00631 // Returns the type_info for the currently handled exception [15.3/8], or 00632 // null if there is none. 00633 std::type_info* 00634 __cxa_current_exception_type() _GLIBCXX_NOTHROW __attribute__ ((__pure__)); 00635 00636 // GNU Extensions. 00637 00638 // Allocate memory for a dependent exception. 00639 __cxa_dependent_exception* 00640 __cxa_allocate_dependent_exception() _GLIBCXX_NOTHROW; 00641 00642 // Free the space allocated for the dependent exception. 00643 void 00644 __cxa_free_dependent_exception(__cxa_dependent_exception*) _GLIBCXX_NOTHROW; 00645 00646 } // extern "C" 00647 00648 // A magic placeholder class that can be caught by reference 00649 // to recognize foreign exceptions. 00650 class __foreign_exception 00651 { 00652 virtual ~__foreign_exception() throw(); 00653 virtual void __pure_dummy() = 0; // prevent catch by value 00654 }; 00655 00656 } // namespace __cxxabiv1 00657 00658 /** @namespace abi 00659 * @brief The cross-vendor C++ Application Binary Interface. A 00660 * namespace alias to __cxxabiv1, but user programs should use the 00661 * alias 'abi'. 00662 * 00663 * A brief overview of an ABI is given in the libstdc++ FAQ, question 00664 * 5.8 (you may have a copy of the FAQ locally, or you can view the online 00665 * version at http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#5_8 ). 00666 * 00667 * GCC subscribes to a cross-vendor ABI for C++, sometimes 00668 * called the IA64 ABI because it happens to be the native ABI for that 00669 * platform. It is summarized at http://www.codesourcery.com/cxx-abi/ 00670 * along with the current specification. 00671 * 00672 * For users of GCC greater than or equal to 3.x, entry points are 00673 * available in <cxxabi.h>, which notes, <em>'It is not normally 00674 * necessary for user programs to include this header, or use the 00675 * entry points directly. However, this header is available should 00676 * that be needed.'</em> 00677 */ 00678 namespace abi = __cxxabiv1; 00679 00680 namespace __gnu_cxx 00681 { 00682 /** 00683 * @brief Exception thrown by __cxa_guard_acquire. 00684 * @ingroup exceptions 00685 * 00686 * 6.7[stmt.dcl]/4: If control re-enters the declaration (recursively) 00687 * while the object is being initialized, the behavior is undefined. 00688 * 00689 * Since we already have a library function to handle locking, we might 00690 * as well check for this situation and throw an exception. 00691 * We use the second byte of the guard variable to remember that we're 00692 * in the middle of an initialization. 00693 */ 00694 class recursive_init_error: public std::exception 00695 { 00696 public: 00697 recursive_init_error() throw() { } 00698 virtual ~recursive_init_error() throw (); 00699 }; 00700 } 00701 #endif // __cplusplus 00702 00703 #pragma GCC visibility pop 00704 00705 #endif // __CXXABI_H