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_const.U
CommitLineData
98232925
JH
1?RCS: $Id: d_const.U,v 3.0.1.1 1993/11/10 17:33:41 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_const.U,v $
12?RCS: Revision 3.0.1.1 1993/11/10 17:33:41 ram
13?RCS: patch14: stronger const check with added typedef for MIPS cc
14?RCS:
15?RCS: Revision 3.0 1993/08/18 12:05:51 ram
16?RCS: Baseline for dist 3.0 netwide release.
17?RCS:
18?MAKE:d_const: cat cc ccflags Setvar
19?MAKE: -pick add $@ %<
20?S:d_const:
21?S: This variable conditionally defines the HASCONST symbol, which
22?S: indicates to the C program that this C compiler knows about the
23?S: const type.
24?S:.
25?C:HASCONST ~ %<:
26?C: This symbol, if defined, indicates that this C compiler knows about
27?C: the const type. There is no need to actually test for that symbol
28?C: within your programs. The mere use of the "const" keyword will
29?C: trigger the necessary tests.
30?C:.
31?H:?%<:#$d_const HASCONST /**/
32?H:?%<:#ifndef HASCONST
33?H:?%<:#define const
34?H:?%<:#endif
35?H:.
36?W:%<:const
37?LINT:set d_const
38?LINT:known const
39: check for const keyword
40echo " "
41echo 'Checking to see if your C compiler knows about "const"...' >&4
42$cat >const.c <<'EOCP'
43?X: mmcg@bruce.cs.monash.edu.au reports that:
44?X: The MIPS cc compiler (V2.10) on a dec 5000 running Ultrix 4.2A
45?X: pretends to understand `const' but doesn't - it'll also fail to
46?X: handle typedefs properly if they're declared const. To guard
47?X: against this, boost up the test by using an explicit typedef...
48typedef struct spug { int drokk; } spug;
49int main()
50{
51 const char *foo;
52 const spug y = { 0 };
53}
54EOCP
55if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
56 val="$define"
57 echo "Yup, it does."
58else
59 val="$undef"
60 echo "Nope, it doesn't."
61fi
62set d_const
63eval $setvar
64