1 /* c-proto.h: macros to include or discard prototypes.
3 Copyright 1992 Karl Berry
4 Copyright 2007 TeX Users Group
5 Copyright 2014 Clerk Ma
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 /* Although most of the code here is written in GNU C, a few files are
26 shared with other distributions (TeX, xdvi, dvips), and so need to be
27 compilable with common C, also. Here are macros which play around
28 with function declarations to make them work in both cases. The P?H
29 macros are used for declarations, the P?C for definitions. */
34 #define P2H(p1,p2) (p1, p2)
35 #define P3H(p1,p2,p3) (p1, p2, p3)
36 #define P4H(p1,p2,p3,p4) (p1, p2, p3, p4)
37 #define P5H(p1,p2,p3,p4,p5) (p1, p2, p3, p4, p5)
39 #define P1C(t1,n1)(t1 n1)
40 #define P2C(t1,n1, t2,n2)(t1 n1, t2 n2)
41 #define P3C(t1,n1, t2,n2, t3,n3)(t1 n1, t2 n2, t3 n3)
42 #define P4C(t1,n1, t2,n2, t3,n3, t4,n4)(t1 n1, t2 n2, t3 n3, t4 n4)
43 #define P5C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5) \
44 (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5)
46 #else /* not __STDC__ */
49 #define P2H(p1, p2) ()
50 #define P3H(p1, p2, p3) ()
51 #define P4H(p1, p2, p3, p4) ()
52 #define P5H(p1, p2, p3, p4, p5) ()
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;
62 #endif /* not __STDC__ */
64 #endif /* not C_PROTO_H */