1b17d1066Smrg // ABI Support -*- C++ -*- 2b17d1066Smrg 3b1e83836Smrg // Copyright (C) 2016-2022 Free Software Foundation, Inc. 4b17d1066Smrg // 5b17d1066Smrg // This file is part of GCC. 6b17d1066Smrg // 7b17d1066Smrg // GCC is free software; you can redistribute it and/or modify 8b17d1066Smrg // it under the terms of the GNU General Public License as published by 9b17d1066Smrg // the Free Software Foundation; either version 3, or (at your option) 10b17d1066Smrg // any later version. 11b17d1066Smrg // 12b17d1066Smrg // GCC is distributed in the hope that it will be useful, 13b17d1066Smrg // but WITHOUT ANY WARRANTY; without even the implied warranty of 14b17d1066Smrg // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15b17d1066Smrg // GNU General Public License for more details. 16b17d1066Smrg // 17b17d1066Smrg // Under Section 7 of GPL version 3, you are granted additional 18b17d1066Smrg // permissions described in the GCC Runtime Library Exception, version 19b17d1066Smrg // 3.1, as published by the Free Software Foundation. 20b17d1066Smrg 21b17d1066Smrg // You should have received a copy of the GNU General Public License and 22b17d1066Smrg // a copy of the GCC Runtime Library Exception along with this program; 23b17d1066Smrg // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 24b17d1066Smrg // <http://www.gnu.org/licenses/>. 25b17d1066Smrg 26b17d1066Smrg /** @file bits/cxxabi_init_exception.h 27b17d1066Smrg * This is an internal header file, included by other library headers. 28b17d1066Smrg * Do not attempt to use it directly. 29b17d1066Smrg */ 30b17d1066Smrg 31b17d1066Smrg #ifndef _CXXABI_INIT_EXCEPTION_H 32b17d1066Smrg #define _CXXABI_INIT_EXCEPTION_H 1 33b17d1066Smrg 34b17d1066Smrg #pragma GCC system_header 35b17d1066Smrg 36b17d1066Smrg #pragma GCC visibility push(default) 37b17d1066Smrg 38b17d1066Smrg #include <stddef.h> 39b17d1066Smrg #include <bits/c++config.h> 40b17d1066Smrg 41b17d1066Smrg #ifndef _GLIBCXX_CDTOR_CALLABI 42b17d1066Smrg #define _GLIBCXX_CDTOR_CALLABI 43b17d1066Smrg #define _GLIBCXX_HAVE_CDTOR_CALLABI 0 44b17d1066Smrg #else 45b17d1066Smrg #define _GLIBCXX_HAVE_CDTOR_CALLABI 1 46b17d1066Smrg #endif 47b17d1066Smrg 48b17d1066Smrg #ifdef __cplusplus 49b17d1066Smrg 50b17d1066Smrg namespace std 51b17d1066Smrg { 52b17d1066Smrg class type_info; 53b17d1066Smrg } 54b17d1066Smrg 55b17d1066Smrg namespace __cxxabiv1 56b17d1066Smrg { 57b17d1066Smrg struct __cxa_refcounted_exception; 58b17d1066Smrg 59b17d1066Smrg extern "C" 60b17d1066Smrg { 61b17d1066Smrg // Allocate memory for the primary exception plus the thrown object. 62b17d1066Smrg void* 63b17d1066Smrg __cxa_allocate_exception(size_t) _GLIBCXX_NOTHROW; 64b17d1066Smrg 65b17d1066Smrg void 66b17d1066Smrg __cxa_free_exception(void*) _GLIBCXX_NOTHROW; 67b17d1066Smrg 68b17d1066Smrg // Initialize exception (this is a GNU extension) 69b17d1066Smrg __cxa_refcounted_exception* 70*0a307195Smrg __cxa_init_primary_exception(void *__object, std::type_info *__tinfo, 71*0a307195Smrg void (_GLIBCXX_CDTOR_CALLABI *__dest) (void *)) 72*0a307195Smrg _GLIBCXX_NOTHROW; 73b17d1066Smrg 74b17d1066Smrg } 75b17d1066Smrg } // namespace __cxxabiv1 76b17d1066Smrg 77b17d1066Smrg #endif 78b17d1066Smrg 79b17d1066Smrg #pragma GCC visibility pop 80b17d1066Smrg 81b17d1066Smrg #endif // _CXXABI_INIT_EXCEPTION_H 82