path: root/mcon/U/d_const.U
diff options
Diffstat (limited to 'mcon/U/d_const.U')
1 files changed, 64 insertions, 0 deletions
diff --git a/mcon/U/d_const.U b/mcon/U/d_const.U
new file mode 100644
index 0000000..cde8bd1
--- /dev/null
+++ b/mcon/U/d_const.U
@@ -0,0 +1,64 @@
+?RCS: $Id: d_const.U,v 1993/11/10 17:33:41 ram Exp $
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?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: $Log: d_const.U,v $
+?RCS: Revision 1993/11/10 17:33:41 ram
+?RCS: patch14: stronger const check with added typedef for MIPS cc
+?RCS: Revision 3.0 1993/08/18 12:05:51 ram
+?RCS: Baseline for dist 3.0 netwide release.
+?MAKE:d_const: cat cc ccflags Setvar
+?MAKE: -pick add $@ %<
+?S: This variable conditionally defines the HASCONST symbol, which
+?S: indicates to the C program that this C compiler knows about the
+?S: const type.
+?C:HASCONST ~ %<:
+?C: This symbol, if defined, indicates that this C compiler knows about
+?C: the const type. There is no need to actually test for that symbol
+?C: within your programs. The mere use of the "const" keyword will
+?C: trigger the necessary tests.
+?H:?%<:#$d_const HASCONST /**/
+?H:?%<:#ifndef HASCONST
+?H:?%<:#define const
+?LINT:set d_const
+?LINT:known const
+: check for const keyword
+echo " "
+echo 'Checking to see if your C compiler knows about "const"...' >&4
+$cat >const.c <<'EOCP'
+?X: reports that:
+?X: The MIPS cc compiler (V2.10) on a dec 5000 running Ultrix 4.2A
+?X: pretends to understand `const' but doesn't - it'll also fail to
+?X: handle typedefs properly if they're declared const. To guard
+?X: against this, boost up the test by using an explicit typedef...
+typedef struct spug { int drokk; } spug;
+ const char *foo;
+ const spug y;
+if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
+ val="$define"
+ echo "Yup, it does."
+ val="$undef"
+ echo "Nope, it doesn't."
+set d_const
+eval $setvar