This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
RE: [perl #26136] localtime(3) calls tzset(3), but localtime_r(3) may not.
[metaconfig.git] / U / modified / d_voidsig.U
CommitLineData
959f3c4c
JH
1?RCS: $Id: d_voidsig.U,v 3.0.1.3 1995/05/12 12:12:46 ram Exp $
2?RCS:
3?RCS: Copyright (c) 1991-1993, Raphael Manfredi
4?RCS:
5?RCS: You may redistribute only under the terms of the Artistic Licence,
6?RCS: as specified in the README file that comes with the distribution.
7?RCS: You may reuse parts of this distribution only within the terms of
8?RCS: that same Artistic Licence; a copy of which may be found at the root
9?RCS: of the source tree for dist 3.0.
10?RCS:
11?RCS: $Log: d_voidsig.U,v $
12?RCS: Revision 3.0.1.3 1995/05/12 12:12:46 ram
13?RCS: patch54: made cppflags dependency optional
14?RCS:
15?RCS: Revision 3.0.1.2 1994/08/29 16:20:35 ram
16?RCS: patch32: now sets signal_t only once d_voidsig is known (WED)
17?RCS:
18?RCS: Revision 3.0.1.1 1994/06/20 06:59:54 ram
19?RCS: patch30: now properly sets signal_t when re-using previous value
20?RCS:
21?RCS: Revision 3.0 1993/08/18 12:07:56 ram
22?RCS: Baseline for dist 3.0 netwide release.
23?RCS:
24?MAKE:d_voidsig signal_t: rm contains cppstdin cppminus +cppflags test Myread \
25 Oldconfig Setvar Findhdr
26?MAKE: -pick add $@ %<
27?S:d_voidsig:
28?S: This variable conditionally defines VOIDSIG if this system
29?S: declares "void (*signal(...))()" in signal.h. The old way was to
30?S: declare it as "int (*signal(...))()".
31?S:.
32?S:signal_t:
33?S: This variable holds the type of the signal handler (void or int).
34?S:.
35?C:VOIDSIG:
36?C: This symbol is defined if this system declares "void (*signal(...))()" in
37?C: signal.h. The old way was to declare it as "int (*signal(...))()". It
38?C: is up to the package author to declare things correctly based on the
39?C: symbol.
40?C:.
41?C:Signal_t (SIGNAL_T):
42?C: This symbol's value is either "void" or "int", corresponding to the
43?C: appropriate return type of a signal handler. Thus, you can declare
44?C: a signal handler using "Signal_t (*handler)()", and define the
45?C: handler using "Signal_t handler(sig)".
46?C:.
47?H:#$d_voidsig VOIDSIG /**/
48?H:#define Signal_t $signal_t /* Signal handler's return type */
49?H:.
50?T:xxx
51?LINT:set d_voidsig
52: see if signal is declared as pointer to function returning int or void
53echo " "
54xxx=`./findhdr signal.h`
55$test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
56if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
57 echo "You have int (*signal())() instead of void." >&4
58 val="$undef"
59elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
60 echo "You have void (*signal())()." >&4
61 val="$define"
62elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
63 echo "You have int (*signal())() instead of void." >&4
64 val="$undef"
65?X: This next test is kind of sloppy, but it catches Linux
66?X: which has a
67?X: typedef void (*__sighandler_t) (int) ;
68?X: A better fix would be to compile a C program with the propoer
69?X: prototype, but since nearly everyone uses void, we'll just go with
70?X: this.
71elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
72 echo "You have void (*signal())()." >&4
73 val="$define"
74else
75 case "$d_voidsig" in
76 '')
77 echo "I can't determine whether signal handler returns void or int..." >&4
78 dflt=void
79 rp="What type does your signal handler return?"
80 . ./myread
81 case "$ans" in
82 v*) val="$define";;
83 *) val="$undef";;
84 esac;;
85 "$define")
86 echo "As you already told me, signal handler returns void." >&4
87 val="$define"
88 ;;
89 *) echo "As you already told me, signal handler returns int." >&4
90 val="$undef"
91 ;;
92 esac
93fi
94set d_voidsig
95eval $setvar
96case "$d_voidsig" in
97"$define") signal_t="void";;
98*) signal_t="int";;
99esac
100$rm -f $$.tmp
101