Commit | Line | Data |
---|---|---|
d8875586 MBT |
1 | ?RCS: $Id: vaproto.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: Orginal Author: Graham Stoney <greyham@research.canon.oz.au> | |
12 | ?RCS: | |
13 | ?RCS: $Log: vaproto.U,v $ | |
14 | ?RCS: Revision 3.0.1.1 1994/01/24 14:17:16 ram | |
15 | ?RCS: patch16: definition of _V now appears only when needed | |
16 | ?RCS: | |
17 | ?RCS: Revision 3.0 1993/08/18 12:09:59 ram | |
18 | ?RCS: Baseline for dist 3.0 netwide release. | |
19 | ?RCS: | |
20 | ?MAKE:vaproto: prototype i_stdarg Setvar | |
21 | ?MAKE: -pick add $@ %< | |
22 | ?S:vaproto: | |
23 | ?S: This variable conditionally defines CAN_VAPROTO on systems supporting | |
24 | ?S: prototype declaration of functions with a variable number of | |
25 | ?S: arguments. See also prototype. | |
26 | ?S:. | |
27 | ?C:CAN_VAPROTO ~ %<: | |
28 | ?C: This variable is defined on systems supporting prototype declaration | |
29 | ?C: of functions with a variable number of arguments. | |
30 | ?C:. | |
31 | ?C:_V: | |
32 | ?C: This macro is used to declare function parameters in prototypes for | |
33 | ?C: functions with a variable number of parameters. Use double parentheses. | |
34 | ?C: For example: | |
35 | ?C: | |
36 | ?C: int printf _V((char *fmt, ...)); | |
37 | ?C: | |
38 | ?C: Remember to use the plain simple _() macro when declaring a function | |
39 | ?C: with no variable number of arguments, since it might be possible to | |
40 | ?C: have a non-effect _V() macro and still get prototypes via _(). | |
41 | ?C:. | |
42 | ?H:?%<:#$vaproto CAN_VAPROTO /**/ | |
43 | ?H:?_V:#ifdef CAN_VAPROTO | |
44 | ?H:?_V:#define _V(args) args | |
45 | ?H:?_V:#else | |
46 | ?H:?_V:#define _V(args) () | |
47 | ?H:?_V:#endif | |
48 | ?H:. | |
49 | ?W:%<:_V | |
50 | ?LINT:set vaproto | |
51 | : see if prototypes support variable argument declarations | |
52 | echo " " | |
53 | case "$prototype$i_stdarg" in | |
54 | $define$define) | |
55 | echo "It appears we'll be able to prototype varargs functions." >&4 | |
56 | val="$define" | |
57 | ;; | |
58 | *) | |
59 | echo "Too bad... We won't be using prototyped varargs functions..." >&4 | |
60 | val="$undef" | |
61 | ;; | |
62 | esac | |
63 | set vaproto | |
64 | eval $setvar | |
65 |