Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
EXTERNAL_HEADERS
RSL
etc
config
src
SIG_ATOMIC_T.cpp
Go to the documentation of this file.
1
// checking for signal support in <signal.h>
2
3
25
#include <
signal.h
>
26
#include <
stdio.h
>
27
28
#include "config.h"
29
30
// establish a dependency on the test for long long
31
// and #define the LONG_LONG macro used in "type.h"
32
#ifndef _RWSTD_NO_LONG_LONG
33
# define LONG_LONG long long
34
#else
// if defined (_RWSTD_NO_LONG_LONG)
35
# if defined (_MSC_VER)
36
# define LONG_LONG __int64
37
# endif
// _MSC_VER
38
#endif
// _RWSTD_NO_LONG_LONG
39
40
#include "
types.h
"
// for type_name()
41
42
43
int
main
()
44
{
45
#if defined (SIG_DFL)
46
printf
(
"#define _RWSTD_SIG_DFL %2d\n"
,
SIG_DFL
);
47
#endif
// SIG_DFL
48
49
#if defined (SIG_ERR)
50
printf
(
"#define _RWSTD_SIG_ERR %2d\n"
,
SIG_ERR
);
51
#endif
// SIG_ERR
52
53
#if defined (SIG_IGN)
54
printf
(
"#define _RWSTD_SIG_IGN %2d\n"
,
SIG_IGN
);
55
#endif
// SIG_IGN
56
57
#if defined (SIGABRT)
58
printf
(
"#define _RWSTD_SIGABRT %2d\n"
,
SIGABRT
);
59
#endif
// SIGABRT
60
61
#if defined (SIGFPE)
62
printf
(
"#define _RWSTD_SIGFPE %2d\n"
,
SIGFPE
);
63
#endif
// SIGFPE
64
65
#if defined (SIGILL)
66
printf
(
"#define _RWSTD_SIGILL %2d\n"
,
SIGILL
);
67
#endif
// SIGILL
68
69
#if defined (SIGINT)
70
printf
(
"#define _RWSTD_SIGINT %2d\n"
,
SIGINT
);
71
#endif
// SIGINT
72
73
#if defined (SIGSEGV)
74
printf
(
"#define _RWSTD_SIGSEGV %2d\n"
,
SIGSEGV
);
75
#endif
// SIGSEGV
76
77
#if defined (SIGTERM)
78
printf
(
"#define _RWSTD_SIGTERM %2d\n"
,
SIGTERM
);
79
#endif
// SIGTERM
80
82
// determine the underlying arithmetic type
83
84
sig_atomic_t atomic = 0;
85
const
char
*
const
tname =
type_name
(atomic);
86
printf
(
"#define _RWSTD_SIG_ATOMIC_T %s\n"
, tname);
87
88
// compute the type's minimum and maximum
89
const
char
*
const
symbol =
type_name
(++atomic);
90
91
printf
(
"#define _RWSTD_SIG_ATOMIC_MIN _RWSTD_%s_MIN\n"
92
"#define _RWSTD_SIG_ATOMIC_MAX _RWSTD_%s_MAX\n"
,
93
symbol, symbol);
94
95
return
0;
96
}
type_name
const char * type_name()
printf
IMPORT_C SInt32 printf(const Char *,...)
main
int main()
Definition
SIG_ATOMIC_T.cpp:43
SIG_DFL
#define SIG_DFL
SIG_ERR
#define SIG_ERR
SIGINT
#define SIGINT
SIGILL
#define SIGILL
SIGTERM
#define SIGTERM
SIGFPE
#define SIGFPE
SIGABRT
#define SIGABRT
SIG_IGN
#define SIG_IGN
SIGSEGV
#define SIGSEGV
signal.h
stdio.h
types.h
Generated by
1.9.8