x86-64: Make ABI for long double compatible with GCC.
[tinycc/kirr.git] / win32 / include / signal.h
blob4eced969a5f8f20769e179ae36582e3730c7ef1b
1 /*
2 * signal.h
4 * A way to set handlers for exceptional conditions (also known as signals).
6 * This file is part of the Mingw32 package.
8 * Contributors:
9 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 * $Revision: 1.2 $
22 * $Author: bellard $
23 * $Date: 2005/04/17 13:14:29 $
27 #ifndef _SIGNAL_H_
28 #define _SIGNAL_H_
30 /* All the headers include this file. */
31 #include <_mingw.h>
34 * The actual signal values. Using other values with signal
35 * produces a SIG_ERR return value.
37 * NOTE: SIGINT is produced when the user presses Ctrl-C.
38 * SIGILL has not been tested.
39 * SIGFPE doesn't seem to work?
40 * SIGSEGV does not catch writing to a NULL pointer (that shuts down
41 * your app; can you say "segmentation violation core dump"?).
42 * SIGTERM comes from what kind of termination request exactly?
43 * SIGBREAK is indeed produced by pressing Ctrl-Break.
44 * SIGABRT is produced by calling abort.
45 * TODO: The above results may be related to not installing an appropriate
46 * structured exception handling frame. Results may be better if I ever
47 * manage to get the SEH stuff down.
49 #define SIGINT 2 /* Interactive attention */
50 #define SIGILL 4 /* Illegal instruction */
51 #define SIGFPE 8 /* Floating point error */
52 #define SIGSEGV 11 /* Segmentation violation */
53 #define SIGTERM 15 /* Termination request */
54 #define SIGBREAK 21 /* Control-break */
55 #define SIGABRT 22 /* Abnormal termination (abort) */
57 #define NSIG 23 /* maximum signal number + 1 */
59 #ifndef RC_INVOKED
61 #ifndef _SIG_ATOMIC_T_DEFINED
62 typedef int sig_atomic_t;
63 #define _SIG_ATOMIC_T_DEFINED
64 #endif
67 * The prototypes (below) are the easy part. The hard part is figuring
68 * out what signals are available and what numbers they are assigned
69 * along with appropriate values of SIG_DFL and SIG_IGN.
73 * A pointer to a signal handler function. A signal handler takes a
74 * single int, which is the signal it handles.
76 typedef void (*__p_sig_fn_t)(int);
79 * These are special values of signal handler pointers which are
80 * used to send a signal to the default handler (SIG_DFL), ignore
81 * the signal (SIG_IGN), or indicate an error return (SIG_ERR).
83 #define SIG_DFL ((__p_sig_fn_t) 0)
84 #define SIG_IGN ((__p_sig_fn_t) 1)
85 #define SIG_ERR ((__p_sig_fn_t) -1)
87 #ifdef __cplusplus
88 extern "C" {
89 #endif
92 * Call signal to set the signal handler for signal sig to the
93 * function pointed to by handler. Returns a pointer to the
94 * previous handler, or SIG_ERR if an error occurs. Initially
95 * unhandled signals defined above will return SIG_DFL.
97 __p_sig_fn_t signal(int, __p_sig_fn_t);
100 * Raise the signal indicated by sig. Returns non-zero on success.
102 int raise (int);
104 #ifdef __cplusplus
106 #endif
108 #endif /* Not RC_INVOKED */
110 #endif /* Not _SIGNAL_H_ */