summaryrefslogtreecommitdiffstats
path: root/newlib/libc/include
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/include')
-rw-r--r--newlib/libc/include/signal.h14
-rw-r--r--newlib/libc/include/sys/signal.h8
2 files changed, 9 insertions, 13 deletions
diff --git a/newlib/libc/include/signal.h b/newlib/libc/include/signal.h
index e1170a234..1b3b57b49 100644
--- a/newlib/libc/include/signal.h
+++ b/newlib/libc/include/signal.h
@@ -8,17 +8,9 @@ _BEGIN_STD_C
typedef int sig_atomic_t; /* Atomic entity type (ANSI) */
-#if defined(__STDC__) || defined(__cplusplus)
-#define SIG_DFL ((void (*)(int))0) /* Default action */
-#define SIG_IGN ((void (*)(int))1) /* Ignore action */
-#define SIG_ERR ((void (*)(int))-1) /* Error return */
-#else
-#define SIG_DFL ((void (*)())0) /* Default action */
-#define SIG_IGN ((void (*)())1) /* Ignore action */
-#define SIG_ERR ((void (*)())-1) /* Error return */
-#endif
-
-typedef void (*_sig_func_ptr) (int);
+#define SIG_DFL ((_sig_func_ptr)0) /* Default action */
+#define SIG_IGN ((_sig_func_ptr)1) /* Ignore action */
+#define SIG_ERR ((_sig_func_ptr)-1) /* Error return */
struct _reent;
diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/signal.h
index 11d370ac4..dde3aaa04 100644
--- a/newlib/libc/include/sys/signal.h
+++ b/newlib/libc/include/sys/signal.h
@@ -84,13 +84,15 @@ typedef struct {
* application should not use both simultaneously.
*/
+typedef void (*_sig_func_ptr)();
+
struct sigaction {
int sa_flags; /* Special flags to affect behavior of signal */
sigset_t sa_mask; /* Additional set of signals to be blocked */
/* during execution of signal-catching */
/* function. */
union {
- void (*_handler)(); /* SIG_DFL, SIG_IGN, or pointer to a function */
+ _sig_func_ptr _handler; /* SIG_DFL, SIG_IGN, or pointer to a function */
#if defined(_POSIX_REALTIME_SIGNALS)
void (*_sigaction)( int, siginfo_t *, void * );
#endif
@@ -104,9 +106,11 @@ struct sigaction {
#else
+typedef void (*_sig_func_ptr)(int);
+
struct sigaction
{
- void (*sa_handler)(int);
+ _sig_func_ptr sa_handler;
sigset_t sa_mask;
int sa_flags;
};