1 ?RCS: $Id: d_voidsig.U 1 2006-08-24 12:32:52Z rmanfredi $
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
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 4.0.
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
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)
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
21 ?RCS: Revision 3.0 1993/08/18 12:07:56 ram
22 ?RCS: Baseline for dist 3.0 netwide release.
24 ?MAKE:d_voidsig signal_t: rm contains cppstdin cppminus +cppflags test Myread \
25 Oldconfig Setvar Findhdr
26 ?MAKE: -pick add $@ %<
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(...))()".
33 ?S: This variable holds the type of the signal handler (void or int).
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
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)".
47 ?H:#$d_voidsig VOIDSIG /**/
48 ?H:#define Signal_t $signal_t /* Signal handler's return type */
52 : see if signal is declared as pointer to function returning int or void
54 xxx=`./findhdr signal.h`
55 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
56 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
57 echo "You have int (*signal())() instead of void." >&4
59 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
60 echo "You have void (*signal())() instead of int." >&4
62 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
63 echo "You have int (*signal())() instead of void." >&4
68 echo "I can't determine whether signal handler returns void or int..." >&4
70 rp="What type does your signal handler return?"
77 echo "As you already told me, signal handler returns void." >&4;;
79 echo "As you already told me, signal handler returns int." >&4;;
85 "$define") signal_t="void";;