cxxabi_init_exception.h 2.2 KB

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