Commit | Line | Data |
---|---|---|
d8875586 MBT |
1 | ?RCS: $Id: d_time.U 1 2006-08-24 12:32:52Z rmanfredi $ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1991-1997, 2004-2006, 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 4.0. | |
10 | ?RCS: | |
11 | ?RCS: $Log: d_time.U,v $ | |
12 | ?RCS: Revision 3.0.1.2 1995/07/25 14:07:43 ram | |
13 | ?RCS: patch56: typo fix, sytem -> system | |
14 | ?RCS: | |
15 | ?RCS: Revision 3.0.1.1 1994/10/29 16:16:38 ram | |
16 | ?RCS: patch36: now uses new Typedef unit to compute type information (ADO) | |
17 | ?RCS: | |
18 | ?RCS: Revision 3.0 1993/08/18 12:07:45 ram | |
19 | ?RCS: Baseline for dist 3.0 netwide release. | |
20 | ?RCS: | |
21 | ?X: Maybe <sys/types.h> should be included? | |
22 | ?X:INC: i_systypes | |
23 | ?MAKE:d_time timetype: Csym Setvar Findhdr Myread Typedef | |
24 | ?MAKE: -pick add $@ %< | |
25 | ?S:d_time: | |
26 | ?S: This variable conditionally defines the HAS_TIME symbol, which indicates | |
27 | ?S: that the time() routine exists. The time() routine is normaly | |
28 | ?S: provided on UNIX systems. | |
29 | ?S:. | |
30 | ?S:timetype: | |
31 | ?S: This variable holds the type returned by time(). It can be long, | |
32 | ?S: or time_t on BSD sites (in which case <sys/types.h> should be | |
33 | ?S: included). Anyway, the type Time_t should be used. | |
34 | ?S:. | |
35 | ?C:HAS_TIME (TIMER): | |
36 | ?C: This symbol, if defined, indicates that the time() routine exists. | |
37 | ?C:. | |
38 | ?C:Time_t (TIMETYPE): | |
39 | ?C: This symbol holds the type returned by time(). It can be long, | |
40 | ?C: or time_t on BSD sites (in which case <sys/types.h> should be | |
41 | ?C: included). | |
42 | ?C:. | |
43 | ?H:#$d_time HAS_TIME /**/ | |
44 | ?H:#define Time_t $timetype /* Time type */ | |
45 | ?H:. | |
46 | ?LINT:set d_time | |
47 | : see if time exists | |
48 | echo " " | |
49 | if set time val -f d_time; eval $csym; $val; then | |
50 | echo 'time() found.' >&4 | |
51 | val="$define" | |
52 | set time_t timetype long stdio.h sys/types.h | |
53 | eval $typedef | |
54 | dflt="$timetype" | |
55 | echo " " | |
56 | rp="What type is returned by time() on this system?" | |
57 | . ./myread | |
58 | timetype="$ans" | |
59 | else | |
60 | echo 'time() not found, hope that will do.' >&4 | |
61 | val="$undef" | |
62 | timetype='int'; | |
63 | fi | |
64 | set d_time | |
65 | eval $setvar | |
66 |