Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
Louis Dionne | 9bd9388 | 2021-11-17 16:25:01 -0500 | [diff] [blame] | 2 | //===----------------------------------------------------------------------===// |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 3 | // |
Chandler Carruth | d201210 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 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 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef _LIBCPP_CSIGNAL |
| 11 | #define _LIBCPP_CSIGNAL |
| 12 | |
| 13 | /* |
| 14 | csignal synopsis |
| 15 | |
| 16 | Macros: |
| 17 | |
| 18 | SIG_DFL |
| 19 | SIG_ERR |
| 20 | SIG_IGN |
| 21 | SIGABRT |
| 22 | SIGFPE |
| 23 | SIGILL |
| 24 | SIGINT |
| 25 | SIGSEGV |
| 26 | SIGTERM |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 27 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 28 | namespace std |
| 29 | { |
| 30 | |
| 31 | Types: |
| 32 | |
| 33 | sig_atomic_t |
| 34 | |
| 35 | void (*signal(int sig, void (*func)(int)))(int); |
| 36 | int raise(int sig); |
| 37 | |
| 38 | } // std |
| 39 | |
| 40 | */ |
| 41 | |
Louis Dionne | b4fce35 | 2022-03-25 12:55:36 -0400 | [diff] [blame] | 42 | #include <__assert> // all public C++ headers provide the assertion handler |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 43 | #include <__config> |
Louis Dionne | 4ccfe80 | 2022-05-23 16:48:47 -0400 | [diff] [blame] | 44 | |
Louis Dionne | 47039e3 | 2022-11-22 13:42:33 -0500 | [diff] [blame] | 45 | // <signal.h> is not provided by libc++ |
Louis Dionne | 4ccfe80 | 2022-05-23 16:48:47 -0400 | [diff] [blame] | 46 | #if __has_include(<signal.h>) |
Louis Dionne | 47039e3 | 2022-11-22 13:42:33 -0500 | [diff] [blame] | 47 | # include <signal.h> |
| 48 | # ifdef _LIBCPP_SIGNAL_H |
| 49 | # error "If libc++ starts defining <signal.h>, the __has_include check should move to libc++'s <signal.h>" |
| 50 | # endif |
Louis Dionne | 4ccfe80 | 2022-05-23 16:48:47 -0400 | [diff] [blame] | 51 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 52 | |
Howard Hinnant | aaaa52b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 53 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
Arthur O'Dwyer | 6eeaa00 | 2022-02-01 20:16:40 -0500 | [diff] [blame] | 54 | # pragma GCC system_header |
Howard Hinnant | aaaa52b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 55 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 56 | |
| 57 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 58 | |
Louis Dionne | 9c660c6 | 2021-06-02 10:41:37 -0400 | [diff] [blame] | 59 | using ::sig_atomic_t _LIBCPP_USING_IF_EXISTS; |
| 60 | using ::signal _LIBCPP_USING_IF_EXISTS; |
| 61 | using ::raise _LIBCPP_USING_IF_EXISTS; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 62 | |
| 63 | _LIBCPP_END_NAMESPACE_STD |
| 64 | |
Louis Dionne | 2b1ceaa | 2021-04-20 12:03:32 -0400 | [diff] [blame] | 65 | #endif // _LIBCPP_CSIGNAL |