summaryrefslogtreecommitdiff
path: root/U/voidflags.U
diff options
context:
space:
mode:
Diffstat (limited to 'U/voidflags.U')
-rw-r--r--U/voidflags.U148
1 files changed, 0 insertions, 148 deletions
diff --git a/U/voidflags.U b/U/voidflags.U
deleted file mode 100644
index 7d9a0d06ba..0000000000
--- a/U/voidflags.U
+++ /dev/null
@@ -1,148 +0,0 @@
-?RCS: $Id: voidflags.U,v 3.0 1993/08/18 12:10:01 ram Exp $
-?RCS:
-?RCS: Copyright (c) 1991-1993, Raphael Manfredi
-?RCS:
-?RCS: You may redistribute only under the terms of the Artistic Licence,
-?RCS: as specified in the README file that comes with the distribution.
-?RCS: You may reuse parts of this distribution only within the terms of
-?RCS: that same Artistic Licence; a copy of which may be found at the root
-?RCS: of the source tree for dist 3.0.
-?RCS:
-?RCS: $Log: voidflags.U,v $
-?RCS: Revision 3.0 1993/08/18 12:10:01 ram
-?RCS: Baseline for dist 3.0 netwide release.
-?RCS:
-?MAKE:voidflags defvoidused: cat rm contains cc package Oldconfig Myread
-?MAKE: -pick add $@ %<
-?S:voidflags:
-?S: This variable contains the eventual value of the VOIDFLAGS symbol,
-?S: which indicates how much support of the void type is given by this
-?S: compiler. See VOIDFLAGS for more info.
-?S:.
-?X: Exceptionally, we have to explicitely alias the symbol name for
-?X: config_h.SH, otherwise the comment would not appear.
-?C:VOIDFLAGS ~ %<:
-?C: This symbol indicates how much support of the void type is given by this
-?C: compiler. What various bits mean:
-?C:
-?C: 1 = supports declaration of void
-?C: 2 = supports arrays of pointers to functions returning void
-?C: 4 = supports comparisons between pointers to void functions and
-?C: addresses of void functions
-?C: 8 = suports declaration of generic void pointers
-?C:
-?C: The package designer should define VOIDUSED to indicate the requirements
-?C: of the package. This can be done either by #defining VOIDUSED before
-?C: including config.h, or by defining defvoidused in Myinit.U. If the
-?C: latter approach is taken, only those flags will be tested. If the
-?C: level of void support necessary is not present, defines void to int.
-?C:.
-?H:?%<:#ifndef VOIDUSED
-?H:?%<:# define VOIDUSED $defvoidused
-?H:?%<:#endif
-?H:?%<:#define VOIDFLAGS $voidflags
-?H:?%<:#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
-?H:?%<:# define void int /* is void to be avoided? */
-?H:?%<:# define M_VOID /* Xenix strikes again */
-?H:?%<:# define VOID
-?H:?%<:#else
-?H:?%<:# define VOID void
-?H:?%<:#endif
-?H:.
-?W:%<:void VOID VOIDUSED
-?INIT:: full support for void wanted by default
-?INIT:defvoidused=15
-?INIT:
-?LINT:describe defvoidused
-?LINT:known void M_VOID VOIDUSED
-: check for void type
-echo " "
-$cat >&4 <<EOM
-Checking to see how well your C compiler groks the void type...
-
- Support flag bits are:
- 1: basic void declarations.
- 2: arrays of pointers to functions returning void.
- 4: operations between pointers to and addresses of void functions.
- 8: generic void pointers.
-
-EOM
-case "$voidflags" in
-'')
- $cat >try.c <<'EOCP'
-#if TRY & 1
-void main() {
-#else
-main() {
-#endif
- extern void moo(); /* function returning void */
- void (*goo)(); /* ptr to func returning void */
-#if TRY & 8
- void *hue; /* generic ptr */
-#endif
-#if TRY & 2
- void (*foo[10])();
-#endif
-
-#if TRY & 4
- if(goo == moo) {
- exit(0);
- }
-#endif
- exit(0);
-}
-EOCP
-?X: This unit used to use cc -S in those tests to try to speed up things, but
-?X: unfortunately, AIX 3.2 does not support this option.
- if $cc -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
- voidflags=$defvoidused
- echo "It appears to support void to the level $package wants ($defvoidused)."
- if $contains warning .out >/dev/null 2>&1; then
- echo "However, you might get some warnings that look like this:"
- $cat .out
- fi
- else
-echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
- if $cc -c -DTRY=1 try.c >/dev/null 2>&1 ; then
- echo "It supports 1..."
- if $cc -c -DTRY=3 try.c >/dev/null 2>&1 ; then
- echo "It also supports 2..."
- if $cc -c -DTRY=7 try.c >/dev/null 2>&1 ; then
- voidflags=7
- echo "And it supports 4 but not 8 definitely."
- else
- echo "It doesn't support 4..."
- if $cc -c -DTRY=11 try.c >/dev/null 2>&1 ; then
- voidflags=11
- echo "But it supports 8."
- else
- voidflags=3
- echo "Neither does it support 8."
- fi
- fi
- else
- echo "It does not support 2..."
- if $cc -c -DTRY=13 try.c >/dev/null 2>&1 ; then
- voidflags=13
- echo "But it supports 4 and 8."
- else
- if $cc -c -DTRY=5 try.c >/dev/null 2>&1 ; then
- voidflags=5
- echo "And it supports 4 but has not heard about 8."
- else
- echo "However it supports 8 but not 4."
- fi
- fi
- fi
- else
- echo "There is no support at all for void."
- voidflags=0
- fi
- fi
-esac
-dflt="$voidflags";
-rp="Your void support flags add up to what?"
-. ./myread
-voidflags="$ans"
-$rm -f try.* .out
-