home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / octa21fs.zip / octave / kpathsea / c-proto.h < prev    next >
C/C++ Source or Header  |  2000-01-15  |  3KB  |  87 lines

  1. /* c-proto.h: macros to include or discard prototypes.
  2.  
  3. Copyright (C) 1992, 93, 95, 96 Free Software Foundation, Inc.
  4.  
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Library General Public
  7. License as published by the Free Software Foundation; either
  8. version 2 of the License, or (at your option) any later version.
  9.  
  10. This library 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 GNU
  13. Library General Public License for more details.
  14.  
  15. You should have received a copy of the GNU Library General Public
  16. License along with this library; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  18.  
  19. #ifndef KPATHSEA_C_PROTO_H
  20. #define KPATHSEA_C_PROTO_H
  21.  
  22. #if !defined(WIN32)
  23. #define DllImport
  24. #define __cdecl
  25. #elif (defined(_DLL) && !defined(_IMPORT)) || !defined(_DLL)
  26. #define DllImport
  27. #else
  28. #define DllImport __declspec(dllimport)
  29. #endif
  30.  
  31. /* These macros munge function declarations to make them work in both
  32.    cases.  The P?H macros are used for declarations, the P?C for
  33.    definitions.  Cf. <ansidecl.h> from the GNU C library.  P1H(void)
  34.    also works for definitions of routines which take no args.  */
  35.  
  36. #ifdef HAVE_PROTOTYPES
  37.  
  38. #define AA(args) args /* For an arbitrary number; ARGS must be in parens.  */
  39.  
  40. #define P1H(p1) (p1)
  41. #define P2H(p1,p2) (p1, p2)
  42. #define P3H(p1,p2,p3) (p1, p2, p3)
  43. #define P4H(p1,p2,p3,p4) (p1, p2, p3, p4)
  44. #define P5H(p1,p2,p3,p4,p5) (p1, p2, p3, p4, p5)
  45. #define P6H(p1,p2,p3,p4,p5,p6) (p1, p2, p3, p4, p5, p6)
  46. #define P7H(p1,p2,p3,p4,p5,p6,p7) (p1, p2, p3, p4, p5, p6, p7)
  47.  
  48. #define P1C(t1,n1)(t1 n1)
  49. #define P2C(t1,n1, t2,n2)(t1 n1, t2 n2)
  50. #define P3C(t1,n1, t2,n2, t3,n3)(t1 n1, t2 n2, t3 n3)
  51. #define P4C(t1,n1, t2,n2, t3,n3, t4,n4)(t1 n1, t2 n2, t3 n3, t4 n4)
  52. #define P5C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5) \
  53.   (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5)
  54. #define P6C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6) \
  55.   (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6)
  56. #define P7C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6, t7,n7) \
  57.   (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7 n7)
  58.  
  59. #else /* not HAVE_PROTOTYPES */
  60.  
  61. #define AA(args) ()
  62.     
  63. #define P1H(p1) ()
  64. #define P2H(p1, p2) ()
  65. #define P3H(p1, p2, p3) ()
  66. #define P4H(p1, p2, p3, p4) ()
  67. #define P5H(p1, p2, p3, p4, p5) ()
  68. #define P6H(p1, p2, p3, p4, p5, p6) ()
  69. #define P7H(p1, p2, p3, p4, p5, p6, p7) ()
  70.  
  71. #define P1C(t1,n1) (n1) t1 n1;
  72. #define P2C(t1,n1, t2,n2) (n1,n2) t1 n1; t2 n2;
  73. #define P3C(t1,n1, t2,n2, t3,n3) (n1,n2,n3) t1 n1; t2 n2; t3 n3;
  74. #define P4C(t1,n1, t2,n2, t3,n3, t4,n4) (n1,n2,n3,n4) \
  75.   t1 n1; t2 n2; t3 n3; t4 n4;
  76. #define P5C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5) (n1,n2,n3,n4,n5) \
  77.   t1 n1; t2 n2; t3 n3; t4 n4; t5 n5;
  78. #define P6C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6) (n1,n2,n3,n4,n5,n6) \
  79.   t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6;
  80. #define P7C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6, t7,n7) \
  81.   (n1,n2,n3,n4,n5,n6,n7) \
  82.   t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; t7 n7;
  83.  
  84. #endif /* not HAVE_PROTOTYPES */
  85.  
  86. #endif /* not KPATHSEA_C_PROTO_H */
  87.