📄 cxxabi.h
字号:
// new abi support -*- C++ -*-
// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
// GCC is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// GCC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with GCC; see the file COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
// Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com>
/* This file declares the new abi entry points into the runtime. It is not
normally necessary for user programs to include this header, or use the
entry points directly. However, this header is available should that be
needed.
Some of the entry points are intended for both C and C++, thus this header
is includable from both C and C++. Though the C++ specific parts are not
available in C, naturally enough. */
#ifndef _CXXABI_H
#define _CXXABI_H 1
#include <stddef.h>
#ifdef __cplusplus
namespace __cxxabiv1
{
extern "C"
{
#endif
// Allocate array.
void*
__cxa_vec_new(size_t __element_count, size_t __element_size,
size_t __padding_size, void (*__constructor) (void*),
void (*__destructor) (void*));
void*
__cxa_vec_new2(size_t __element_count, size_t __element_size,
size_t __padding_size, void (*__constructor) (void*),
void (*__destructor) (void*), void *(*__alloc) (size_t),
void (*__dealloc) (void*));
void*
__cxa_vec_new3(size_t __element_count, size_t __element_size,
size_t __padding_size, void (*__constructor) (void*),
void (*__destructor) (void*), void *(*__alloc) (size_t),
void (*__dealloc) (void*, size_t));
// Construct array.
void
__cxa_vec_ctor(void* __array_address, size_t __element_count,
size_t __element_size, void (*__constructor) (void*),
void (*__destructor) (void*));
void
__cxa_vec_cctor(void* dest_array, void* src_array, size_t element_count,
size_t element_size, void (*constructor) (void*, void*),
void (*destructor) (void*));
// Destruct array.
void
__cxa_vec_dtor(void* __array_address, size_t __element_count,
size_t __element_size, void (*__destructor) (void*));
void
__cxa_vec_cleanup(void* __array_address, size_t __element_count,
size_t __element_size, void (*__destructor) (void*));
// Destruct and release array.
void
__cxa_vec_delete(void* __array_address, size_t __element_size,
size_t __padding_size, void (*__destructor) (void*));
void
__cxa_vec_delete2(void* __array_address, size_t __element_size,
size_t __padding_size, void (*__destructor) (void*),
void (*__dealloc) (void*));
void
__cxa_vec_delete3(void* __array_address, size_t __element_size,
size_t __padding_size, void (*__destructor) (void*),
void (*__dealloc) (void*, size_t));
// The ABI requires a 64-bit type.
__extension__ typedef int __guard __attribute__((mode (__DI__)));
int
__cxa_guard_acquire(__guard*);
void
__cxa_guard_release(__guard*);
void
__cxa_guard_abort(__guard*);
// Pure virtual functions.
void
__cxa_pure_virtual(void);
// Exception handling.
void
__cxa_bad_cast();
void
__cxa_bad_typeid();
// DSO destruction.
int
__cxa_atexit(void (*)(void*), void*, void*);
int
__cxa_finalize(void*);
// Demangling routines.
char*
__cxa_demangle(const char* __mangled_name, char* __output_buffer,
size_t* __length, int* __status);
#ifdef __cplusplus
}
} // namespace __cxxabiv1
#endif
#ifdef __cplusplus
#include <typeinfo>
namespace __cxxabiv1
{
// Type information for int, float etc.
class __fundamental_type_info : public std::type_info
{
public:
explicit
__fundamental_type_info(const char* __n) : std::type_info(__n) { }
virtual
~__fundamental_type_info();
};
// Type information for array objects.
class __array_type_info : public std::type_info
{
public:
explicit
__array_type_info(const char* __n) : std::type_info(__n) { }
virtual
~__array_type_info();
};
// Type information for functions (both member and non-member).
class __function_type_info : public std::type_info
{
public:
explicit
__function_type_info(const char* __n) : std::type_info(__n) { }
virtual
~__function_type_info();
protected:
// Implementation defined member function.
virtual bool
__is_function_p() const;
};
// Type information for enumerations.
class __enum_type_info : public std::type_info
{
public:
explicit
__enum_type_info(const char* __n) : std::type_info(__n) { }
virtual
~__enum_type_info();
};
// Common type information for simple pointers and pointers to member.
class __pbase_type_info : public std::type_info
{
public:
unsigned int __flags; // Qualification of the target object.
const std::type_info* __pointee; // Type of pointed to object.
explicit
__pbase_type_info(const char* __n, int __quals,
const std::type_info* __type)
: std::type_info(__n), __flags(__quals), __pointee(__type)
{ }
virtual
~__pbase_type_info();
// Implementation defined type.
enum __masks
{
__const_mask = 0x1,
__volatile_mask = 0x2,
__restrict_mask = 0x4,
__incomplete_mask = 0x8,
__incomplete_class_mask = 0x10
};
protected:
__pbase_type_info(const __pbase_type_info&);
__pbase_type_info&
operator=(const __pbase_type_info&);
// Implementation defined member functions.
virtual bool
__do_catch(const std::type_info* __thr_type, void** __thr_obj,
unsigned int __outer) const;
inline virtual bool
__pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
unsigned __outer) const;
};
// Type information for simple pointers.
class __pointer_type_info : public __pbase_type_info
{
public:
explicit
__pointer_type_info(const char* __n, int __quals,
const std::type_info* __type)
: __pbase_type_info (__n, __quals, __type) { }
virtual
~__pointer_type_info();
protected:
// Implementation defined member functions.
virtual bool
__is_pointer_p() const;
virtual bool
__pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
unsigned __outer) const;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -