1267
|
1 /* c-proto.h: macros to include or discard prototypes. |
|
2 |
|
3 Copyright (C) 1992, 93 Free Software Foundation, Inc. |
|
4 |
|
5 This program is free software; you can redistribute it and/or modify |
|
6 it under the terms of the GNU General Public License as published by |
|
7 the Free Software Foundation; either version 2, or (at your option) |
|
8 any later version. |
|
9 |
|
10 This program is distributed in the hope that it will be useful, |
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 GNU General Public License for more details. |
|
14 |
|
15 You should have received a copy of the GNU General Public License |
|
16 along with this program; if not, write to the Free Software |
1315
|
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
1267
|
18 |
|
19 #ifndef KPATHSEA_C_PROTO_H |
|
20 #define KPATHSEA_C_PROTO_H |
|
21 |
|
22 /* These macros munge function declarations to make them work in both |
|
23 cases. The P?H macros are used for declarations, the P?C for |
|
24 definitions. Cf. <ansidecl.h> from the GNU C library. P1H(void) |
|
25 also works for definitions of routines which take no args. */ |
|
26 |
|
27 #if __STDC__ |
|
28 |
|
29 #define P1H(p1) (p1) |
|
30 #define P2H(p1,p2) (p1, p2) |
|
31 #define P3H(p1,p2,p3) (p1, p2, p3) |
|
32 #define P4H(p1,p2,p3,p4) (p1, p2, p3, p4) |
|
33 #define P5H(p1,p2,p3,p4,p5) (p1, p2, p3, p4, p5) |
|
34 #define P6H(p1,p2,p3,p4,p5,p6) (p1, p2, p3, p4, p5, p6) |
|
35 |
|
36 #define P1C(t1,n1)(t1 n1) |
|
37 #define P2C(t1,n1, t2,n2)(t1 n1, t2 n2) |
|
38 #define P3C(t1,n1, t2,n2, t3,n3)(t1 n1, t2 n2, t3 n3) |
|
39 #define P4C(t1,n1, t2,n2, t3,n3, t4,n4)(t1 n1, t2 n2, t3 n3, t4 n4) |
|
40 #define P5C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5) \ |
|
41 (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5) |
|
42 #define P6C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6) \ |
|
43 (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6) |
|
44 |
|
45 #else /* not __STDC__ */ |
|
46 |
|
47 #define P1H(p1) () |
|
48 #define P2H(p1, p2) () |
|
49 #define P3H(p1, p2, p3) () |
|
50 #define P4H(p1, p2, p3, p4) () |
|
51 #define P5H(p1, p2, p3, p4, p5) () |
|
52 #define P6H(p1, p2, p3, p4, p5, p6) () |
|
53 |
|
54 #define P1C(t1,n1) (n1) t1 n1; |
|
55 #define P2C(t1,n1, t2,n2) (n1,n2) t1 n1; t2 n2; |
|
56 #define P3C(t1,n1, t2,n2, t3,n3) (n1,n2,n3) t1 n1; t2 n2; t3 n3; |
|
57 #define P4C(t1,n1, t2,n2, t3,n3, t4,n4) (n1,n2,n3,n4) \ |
|
58 t1 n1; t2 n2; t3 n3; t4 n4; |
|
59 #define P5C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5) (n1,n2,n3,n4,n5) \ |
|
60 t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; |
|
61 #define P6C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6) (n1,n2,n3,n4,n5,n6) \ |
|
62 t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; |
|
63 |
|
64 #endif /* not __STDC__ */ |
|
65 |
|
66 #endif /* not KPATHSEA_C_PROTO_H */ |