1 ?X: These units are based on the ones supplied with dist-3.0
2 ?X: patchlevel 22. They have been changed or enhanced to work with
3 ?X: perl5alpha. I would appreciate hearing about any changes,
4 ?X: corrections, or enhancements.
5 ?X: Andy Dougherty doughera@lafcol.lafayette.edu
8 ?X: Easton, PA 18042-1782
9 ?X: Sat Apr 2 15:45:17 EST 1994
10 ?RCS: $Id: voidflags.U,v 3.0 1993/08/18 12:10:01 ram Exp $
12 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
14 ?RCS: You may redistribute only under the terms of the Artistic Licence,
15 ?RCS: as specified in the README file that comes with the distribution.
16 ?RCS: You may reuse parts of this distribution only within the terms of
17 ?RCS: that same Artistic Licence; a copy of which may be found at the root
18 ?RCS: of the source tree for dist 3.0.
20 ?RCS: $Log: voidflags.U,v $
21 ?RCS: Revision 3.0 1993/08/18 12:10:01 ram
22 ?RCS: Baseline for dist 3.0 netwide release.
24 ?MAKE:voidflags defvoidused: cat rm contains cc package Oldconfig Myread
25 ?MAKE: -pick add $@ %<
27 ?S: This variable contains the eventual value of the VOIDFLAGS symbol,
28 ?S: which indicates how much support of the void type is given by this
29 ?S: compiler. See VOIDFLAGS for more info.
31 ?X: Exceptionally, we have to explicitely alias the symbol name for
32 ?X: config_h.SH, otherwise the comment would not appear.
34 ?C: This symbol indicates how much support of the void type is given by this
35 ?C: compiler. What various bits mean:
37 ?C: 1 = supports declaration of void
38 ?C: 2 = supports arrays of pointers to functions returning void
39 ?C: 4 = supports comparisons between pointers to void functions and
40 ?C: addresses of void functions
41 ?C: 8 = suports declaration of generic void pointers
43 ?C: The package designer should define VOIDUSED to indicate the requirements
44 ?C: of the package. This can be done either by #defining VOIDUSED before
45 ?C: including config.h, or by defining defvoidused in Myinit.U. If the
46 ?C: latter approach is taken, only those flags will be tested. If the
47 ?C: level of void support necessary is not present, defines void to int.
49 ?H:?%<:#ifndef VOIDUSED
50 ?H:?%<:# ifdef VOIDWANT
51 ?H:?%<:# define VOIDUSED VOIDWANT
53 ?H:?%<:# define VOIDUSED $defvoidused
56 ?H:?%<:#define VOIDFLAGS $voidflags
57 ?H:?%<:#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
58 ?H:?%<:# define void int /* is void to be avoided? */
59 ?H:?%<:# define M_VOID /* Xenix strikes again */
62 ?H:?%<:# define VOID void
65 ?W:%<:void VOID VOIDWANT
66 ?INIT:: full support for void wanted by default
69 ?LINT:describe defvoidused
70 ?LINT:known void M_VOID VOIDUSED
74 Checking to see how well your C compiler groks the void type...
76 Support flag bits are:
77 1: basic void declarations.
78 2: arrays of pointers to functions returning void.
79 4: operations between pointers to and addresses of void functions.
80 8: generic void pointers.
91 extern void moo(); /* function returning void */
92 void (*goo)(); /* ptr to func returning void */
94 void *hue; /* generic ptr */
108 ?X: This unit used to use cc -S in those tests to try to speed up things, but
109 ?X: unfortunately, AIX 3.2 does not support this option.
110 if $cc -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
111 voidflags=$defvoidused
112 echo "It appears to support void to the level $package wants ($defvoidused)."
113 if $contains warning .out >/dev/null 2>&1; then
114 echo "However, you might get some warnings that look like this:"
118 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
119 if $cc -c -DTRY=1 try.c >/dev/null 2>&1 ; then
120 echo "It supports 1..."
121 if $cc -c -DTRY=3 try.c >/dev/null 2>&1 ; then
122 echo "It also supports 2..."
123 if $cc -c -DTRY=7 try.c >/dev/null 2>&1 ; then
125 echo "And it supports 4 but not 8 definitely."
127 echo "It doesn't support 4..."
128 if $cc -c -DTRY=11 try.c >/dev/null 2>&1 ; then
130 echo "But it supports 8."
133 echo "Neither does it support 8."
137 echo "It does not support 2..."
138 if $cc -c -DTRY=13 try.c >/dev/null 2>&1 ; then
140 echo "But it supports 4 and 8."
142 if $cc -c -DTRY=5 try.c >/dev/null 2>&1 ; then
144 echo "And it supports 4 but has not heard about 8."
146 echo "However it supports 8 but not 4."
151 echo "There is no support at all for void."
157 rp="Your void support flags add up to what?"