diff options
Diffstat (limited to 'newlib/libc/include/signal.h')
-rw-r--r-- | newlib/libc/include/signal.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/newlib/libc/include/signal.h b/newlib/libc/include/signal.h index 1b3b57b49..311149146 100644 --- a/newlib/libc/include/signal.h +++ b/newlib/libc/include/signal.h @@ -1,16 +1,25 @@ #ifndef _SIGNAL_H_ +#ifdef __cplusplus +extern "C" { +#endif #define _SIGNAL_H_ #include "_ansi.h" #include <sys/signal.h> -_BEGIN_STD_C - typedef int sig_atomic_t; /* Atomic entity type (ANSI) */ -#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 */ +#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); struct _reent; @@ -22,6 +31,7 @@ _sig_func_ptr _EXFUN(signal, (int, _sig_func_ptr)); int _EXFUN(raise, (int)); #endif -_END_STD_C - +#ifdef __cplusplus +} +#endif #endif /* _SIGNAL_H_ */ |