xref: /netbsd-src/external/gpl3/gcc.old/dist/libstdc++-v3/libsupc++/cxxabi_init_exception.h (revision 4c3eb207d36f67d31994830c0a694161fc1ca39b)
13ad841b2Smrg // ABI Support -*- C++ -*-
23ad841b2Smrg 
3*4c3eb207Smrg // Copyright (C) 2016-2020 Free Software Foundation, Inc.
43ad841b2Smrg //
53ad841b2Smrg // This file is part of GCC.
63ad841b2Smrg //
73ad841b2Smrg // GCC is free software; you can redistribute it and/or modify
83ad841b2Smrg // it under the terms of the GNU General Public License as published by
93ad841b2Smrg // the Free Software Foundation; either version 3, or (at your option)
103ad841b2Smrg // any later version.
113ad841b2Smrg //
123ad841b2Smrg // GCC is distributed in the hope that it will be useful,
133ad841b2Smrg // but WITHOUT ANY WARRANTY; without even the implied warranty of
143ad841b2Smrg // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
153ad841b2Smrg // GNU General Public License for more details.
163ad841b2Smrg //
173ad841b2Smrg // Under Section 7 of GPL version 3, you are granted additional
183ad841b2Smrg // permissions described in the GCC Runtime Library Exception, version
193ad841b2Smrg // 3.1, as published by the Free Software Foundation.
203ad841b2Smrg 
213ad841b2Smrg // You should have received a copy of the GNU General Public License and
223ad841b2Smrg // a copy of the GCC Runtime Library Exception along with this program;
233ad841b2Smrg // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
243ad841b2Smrg // <http://www.gnu.org/licenses/>.
253ad841b2Smrg 
263ad841b2Smrg /** @file bits/cxxabi_init_exception.h
273ad841b2Smrg  *  This is an internal header file, included by other library headers.
283ad841b2Smrg  *  Do not attempt to use it directly.
293ad841b2Smrg  */
303ad841b2Smrg 
313ad841b2Smrg #ifndef _CXXABI_INIT_EXCEPTION_H
323ad841b2Smrg #define _CXXABI_INIT_EXCEPTION_H 1
333ad841b2Smrg 
343ad841b2Smrg #pragma GCC system_header
353ad841b2Smrg 
363ad841b2Smrg #pragma GCC visibility push(default)
373ad841b2Smrg 
383ad841b2Smrg #include <stddef.h>
393ad841b2Smrg #include <bits/c++config.h>
403ad841b2Smrg 
413ad841b2Smrg #ifndef _GLIBCXX_CDTOR_CALLABI
423ad841b2Smrg #define _GLIBCXX_CDTOR_CALLABI
433ad841b2Smrg #define _GLIBCXX_HAVE_CDTOR_CALLABI 0
443ad841b2Smrg #else
453ad841b2Smrg #define _GLIBCXX_HAVE_CDTOR_CALLABI 1
463ad841b2Smrg #endif
473ad841b2Smrg 
483ad841b2Smrg #ifdef __cplusplus
493ad841b2Smrg 
503ad841b2Smrg namespace std
513ad841b2Smrg {
523ad841b2Smrg   class type_info;
533ad841b2Smrg }
543ad841b2Smrg 
553ad841b2Smrg namespace __cxxabiv1
563ad841b2Smrg {
573ad841b2Smrg   struct __cxa_refcounted_exception;
583ad841b2Smrg 
593ad841b2Smrg   extern "C"
603ad841b2Smrg     {
613ad841b2Smrg       // Allocate memory for the primary exception plus the thrown object.
623ad841b2Smrg       void*
633ad841b2Smrg       __cxa_allocate_exception(size_t) _GLIBCXX_NOTHROW;
643ad841b2Smrg 
653ad841b2Smrg       void
663ad841b2Smrg       __cxa_free_exception(void*) _GLIBCXX_NOTHROW;
673ad841b2Smrg 
683ad841b2Smrg       // Initialize exception (this is a GNU extension)
693ad841b2Smrg       __cxa_refcounted_exception*
703ad841b2Smrg       __cxa_init_primary_exception(void *object, std::type_info *tinfo,
713ad841b2Smrg                 void (_GLIBCXX_CDTOR_CALLABI *dest) (void *)) _GLIBCXX_NOTHROW;
723ad841b2Smrg 
733ad841b2Smrg     }
743ad841b2Smrg } // namespace __cxxabiv1
753ad841b2Smrg 
763ad841b2Smrg #endif
773ad841b2Smrg 
783ad841b2Smrg #pragma GCC visibility pop
793ad841b2Smrg 
803ad841b2Smrg #endif // _CXXABI_INIT_EXCEPTION_H
81