xref: /dflybsd-src/contrib/gcc-8.0/libstdc++-v3/libsupc++/cxxabi_init_exception.h (revision 95059079af47f9a66a175f374f2da1a5020e3255)
138fd1498Szrj // ABI Support -*- C++ -*-
238fd1498Szrj 
338fd1498Szrj // Copyright (C) 2016-2018 Free Software Foundation, Inc.
438fd1498Szrj //
538fd1498Szrj // This file is part of GCC.
638fd1498Szrj //
738fd1498Szrj // GCC is free software; you can redistribute it and/or modify
838fd1498Szrj // it under the terms of the GNU General Public License as published by
938fd1498Szrj // the Free Software Foundation; either version 3, or (at your option)
1038fd1498Szrj // any later version.
1138fd1498Szrj //
1238fd1498Szrj // GCC is distributed in the hope that it will be useful,
1338fd1498Szrj // but WITHOUT ANY WARRANTY; without even the implied warranty of
1438fd1498Szrj // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1538fd1498Szrj // GNU General Public License for more details.
1638fd1498Szrj //
1738fd1498Szrj // Under Section 7 of GPL version 3, you are granted additional
1838fd1498Szrj // permissions described in the GCC Runtime Library Exception, version
1938fd1498Szrj // 3.1, as published by the Free Software Foundation.
2038fd1498Szrj 
2138fd1498Szrj // You should have received a copy of the GNU General Public License and
2238fd1498Szrj // a copy of the GCC Runtime Library Exception along with this program;
2338fd1498Szrj // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
2438fd1498Szrj // <http://www.gnu.org/licenses/>.
2538fd1498Szrj 
2638fd1498Szrj /** @file bits/cxxabi_init_exception.h
2738fd1498Szrj  *  This is an internal header file, included by other library headers.
2838fd1498Szrj  *  Do not attempt to use it directly.
2938fd1498Szrj  */
3038fd1498Szrj 
3138fd1498Szrj #ifndef _CXXABI_INIT_EXCEPTION_H
3238fd1498Szrj #define _CXXABI_INIT_EXCEPTION_H 1
3338fd1498Szrj 
3438fd1498Szrj #pragma GCC system_header
3538fd1498Szrj 
3638fd1498Szrj #pragma GCC visibility push(default)
3738fd1498Szrj 
3838fd1498Szrj #include <stddef.h>
3938fd1498Szrj #include <bits/c++config.h>
4038fd1498Szrj 
4138fd1498Szrj #ifndef _GLIBCXX_CDTOR_CALLABI
4238fd1498Szrj #define _GLIBCXX_CDTOR_CALLABI
4338fd1498Szrj #define _GLIBCXX_HAVE_CDTOR_CALLABI 0
4438fd1498Szrj #else
4538fd1498Szrj #define _GLIBCXX_HAVE_CDTOR_CALLABI 1
4638fd1498Szrj #endif
4738fd1498Szrj 
4838fd1498Szrj #ifdef __cplusplus
4938fd1498Szrj 
5038fd1498Szrj namespace std
5138fd1498Szrj {
5238fd1498Szrj   class type_info;
5338fd1498Szrj }
5438fd1498Szrj 
5538fd1498Szrj namespace __cxxabiv1
5638fd1498Szrj {
5738fd1498Szrj   struct __cxa_refcounted_exception;
5838fd1498Szrj 
5938fd1498Szrj   extern "C"
6038fd1498Szrj     {
6138fd1498Szrj       // Allocate memory for the primary exception plus the thrown object.
6238fd1498Szrj       void*
6338fd1498Szrj       __cxa_allocate_exception(size_t) _GLIBCXX_NOTHROW;
6438fd1498Szrj 
65*58e805e6Szrj       void
66*58e805e6Szrj       __cxa_free_exception(void*) _GLIBCXX_NOTHROW;
67*58e805e6Szrj 
6838fd1498Szrj       // Initialize exception (this is a GNU extension)
6938fd1498Szrj       __cxa_refcounted_exception*
7038fd1498Szrj       __cxa_init_primary_exception(void *object, std::type_info *tinfo,
7138fd1498Szrj                 void (_GLIBCXX_CDTOR_CALLABI *dest) (void *)) _GLIBCXX_NOTHROW;
7238fd1498Szrj 
7338fd1498Szrj     }
7438fd1498Szrj } // namespace __cxxabiv1
7538fd1498Szrj 
7638fd1498Szrj #endif
7738fd1498Szrj 
7838fd1498Szrj #pragma GCC visibility pop
7938fd1498Szrj 
8038fd1498Szrj #endif // _CXXABI_INIT_EXCEPTION_H
81