home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 11 / AUCD11B.iso / LANGUAGES / WraithSet / AwkStuff / MawkSrc / h / vargs < prev    next >
Text File  |  1994-12-14  |  2KB  |  75 lines

  1.  
  2. /********************************************
  3. vargs.h
  4. copyright 1992 Michael D. Brennan
  5.  
  6. This is a source file for mawk, an implementation of
  7. the AWK programming language.
  8.  
  9. Mawk is distributed without warranty under the terms of
  10. the GNU General Public License, version 2, 1991.
  11. ********************************************/
  12.  
  13. /*
  14. $Log: vargs.h,v $
  15.  * Revision 1.4  1994/12/14  14:36:54  mike
  16.  * sometimes stdarg.h exists, but depending on compiler flags it is
  17.  * unusable -- assume NO_PROTOS => NO_STDARG_H
  18.  *
  19.  * Revision 1.3  1994/10/08  19:18:38  mike
  20.  * trivial change
  21.  *
  22.  * Revision 1.2  1993/07/04  12:52:19  mike
  23.  * start on autoconfig changes
  24.  *
  25.  * Revision 1.1.1.1  1993/07/03  18:58:22  mike
  26.  * move source to cvs
  27.  *
  28.  * Revision 1.1  1992/10/02  23:23:41  mike
  29.  * Initial revision
  30.  *
  31. */
  32.  
  33. /* provides common interface to <stdarg.h> or <varargs.h> 
  34.    only used for error messages
  35. */
  36.  
  37. #ifdef     NO_PROTOS
  38. #ifndef    NO_STDARG_H   
  39. #define    NO_STDARG_H  1
  40. #endif
  41. #endif
  42.  
  43. #if     NO_STDARG_H
  44. #include <varargs.h>
  45.  
  46. #ifndef  VA_ALIST
  47.  
  48. #define  VA_ALIST(type, arg)  (va_alist) va_dcl { type arg ;
  49. #define  VA_ALIST2(t1,a1,t2,a2) (va_alist) va_dcl { t1 a1 ; t2 a2 ;
  50.  
  51. #endif
  52.  
  53. #define  VA_START(p,type, last)  va_start(p) ;\
  54.                                  last = va_arg(p,type)
  55.  
  56.  
  57. #define  VA_START2(p,t1,a1,t2,a2)  va_start(p) ;\
  58.                                   a1 = va_arg(p,t1);\
  59.                                   a2 = va_arg(p,t2)
  60.  
  61. #else  /* have stdarg.h */
  62. #include <stdarg.h>
  63.  
  64. #ifndef  VA_ALIST
  65. #define  VA_ALIST(type, arg)  (type arg, ...) {
  66. #define  VA_ALIST2(t1,a1,t2,a2)  (t1 a1,t2 a2,...) {
  67. #endif
  68.  
  69. #define  VA_START(p,type,last)   va_start(p,last)
  70.  
  71. #define  VA_START2(p,t1,a1,t2,a2)  va_start(p,a2)
  72.  
  73. #endif
  74.  
  75.