summaryrefslogtreecommitdiff
path: root/mcon/U/d_volatile.U
blob: f94ca4f8e7aed45ba9014dc8482ef9a5a674e5b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
?RCS: $Id$
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, 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 4.0.
?RCS:
?RCS: $Log: d_volatile.U,v $
?RCS: Revision 3.0.1.2  1995/07/25  14:08:49  ram
?RCS: patch56: made cc and ccflags optional dependencies
?RCS:
?RCS: Revision 3.0.1.1  1993/09/09  11:49:51  ram
?RCS: patch9: volatile definition was swapped over with undef
?RCS:
?RCS: Revision 3.0  1993/08/18  12:07:57  ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
?MAKE:d_volatile: cat +cc +ccflags rm Setvar
?MAKE:	-pick add $@ %<
?S:d_volatile:
?S:	This variable conditionally defines the HASVOLATILE symbol, which
?S:	indicates to the C program that this C compiler knows about the
?S:	volatile declaration.
?S:.
?C:HASVOLATILE ~ %<:
?C:	This symbol, if defined, indicates that this C compiler knows about
?C:	the volatile declaration.
?C:.
?H:?%<:#$d_volatile	HASVOLATILE	/**/
?H:?%<:#ifndef HASVOLATILE
?H:?%<:#define volatile
?H:?%<:#endif
?H:.
?W:%<:volatile
?LINT:set d_volatile
?LINT:known volatile
: check for volatile keyword
echo " "
echo 'Checking to see if your C compiler knows about "volatile"...' >&4
$cat >try.c <<'EOCP'
int main()
{
?X:
?X: The following seven lines added by Bill Campbell <billc@sierra.com>
?X: detect that MIPS compilers do not handle volatile in all situations.
?X:
	typedef struct _goo_struct goo_struct;
	goo_struct * volatile goo = ((goo_struct *)0);
	struct _goo_struct {
		long long_int;
		int reg_int;
		char char_var;
	};
	typedef unsigned short foo_t;
	char *volatile foo;
	volatile int bar;
	volatile foo_t blech;
	foo = foo;
}
EOCP
if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
	val="$define"
	echo "Yup, it does."
else
	val="$undef"
	echo "Nope, it doesn't."
fi
set d_volatile
eval $setvar
$rm -f try.*