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