csignal 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // -*- C++ -*-
  2. //===----------------------------------------------------------------------===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #ifndef _LIBCPP_CSIGNAL
  10. #define _LIBCPP_CSIGNAL
  11. /*
  12. csignal synopsis
  13. Macros:
  14. SIG_DFL
  15. SIG_ERR
  16. SIG_IGN
  17. SIGABRT
  18. SIGFPE
  19. SIGILL
  20. SIGINT
  21. SIGSEGV
  22. SIGTERM
  23. namespace std
  24. {
  25. Types:
  26. sig_atomic_t
  27. void (*signal(int sig, void (*func)(int)))(int);
  28. int raise(int sig);
  29. } // std
  30. */
  31. #include <__assert> // all public C++ headers provide the assertion handler
  32. #include <__config>
  33. // <signal.h> is not provided by libc++
  34. #if __has_include(<signal.h>)
  35. # include <signal.h>
  36. # ifdef _LIBCPP_SIGNAL_H
  37. # error "If libc++ starts defining <signal.h>, the __has_include check should move to libc++'s <signal.h>"
  38. # endif
  39. #endif
  40. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  41. # pragma GCC system_header
  42. #endif
  43. _LIBCPP_BEGIN_NAMESPACE_STD
  44. using ::sig_atomic_t _LIBCPP_USING_IF_EXISTS;
  45. using ::signal _LIBCPP_USING_IF_EXISTS;
  46. using ::raise _LIBCPP_USING_IF_EXISTS;
  47. _LIBCPP_END_NAMESPACE_STD
  48. #endif // _LIBCPP_CSIGNAL