home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / octave-1.1.1p1-base.tgz / octave-1.1.1p1-base.tar / fsf / octave / kpathsea / c-proto.h < prev    next >
C/C++ Source or Header  |  1993-06-11  |  2KB  |  61 lines

  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
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  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.  
  35. #define P1C(t1,n1)(t1 n1)
  36. #define P2C(t1,n1, t2,n2)(t1 n1, t2 n2)
  37. #define P3C(t1,n1, t2,n2, t3,n3)(t1 n1, t2 n2, t3 n3)
  38. #define P4C(t1,n1, t2,n2, t3,n3, t4,n4)(t1 n1, t2 n2, t3 n3, t4 n4)
  39. #define P5C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5) \
  40.   (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5)
  41.  
  42. #else /* not __STDC__ */
  43.  
  44. #define P1H(p1) ()
  45. #define P2H(p1, p2) ()
  46. #define P3H(p1, p2, p3) ()
  47. #define P4H(p1, p2, p3, p4) ()
  48. #define P5H(p1, p2, p3, p4, p5) ()
  49.  
  50. #define P1C(t1,n1) (n1) t1 n1;
  51. #define P2C(t1,n1, t2,n2) (n1, n2) t1 n1; t2 n2;
  52. #define P3C(t1,n1, t2,n2, t3,n3) (n1, n2, n3) t1 n1; t2 n2; t3 n3;
  53. #define P4C(t1,n1, t2,n2, t3,n3, t4,n4) (n1, n2, n3, n4) \
  54.   t1 n1; t2 n2; t3 n3; t4 n4;
  55. #define P5C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5) (n1, n2, n3, n4, n5) \
  56.   t1 n1; t2 n2; t3 n3; t4 n4; t5 n5;
  57.  
  58. #endif /* not __STDC__ */
  59.  
  60. #endif /* not KPATHSEA_C_PROTO_H */
  61.