xref: /illumos-gate/usr/src/lib/libwrap/mystdarg.h (revision 1da57d551424de5a9d469760be7c4b4d4f10a755)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * Copyright 2001 Sun Microsystems, Inc.  All rights reserved.
3*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
4*7c478bd9Sstevel@tonic-gate  */
5*7c478bd9Sstevel@tonic-gate 
6*7c478bd9Sstevel@tonic-gate  /*
7*7c478bd9Sstevel@tonic-gate   * What follows is an attempt to unify varargs.h and stdarg.h. I'd rather
8*7c478bd9Sstevel@tonic-gate   * have this than #ifdefs all over the code.
9*7c478bd9Sstevel@tonic-gate   */
10*7c478bd9Sstevel@tonic-gate 
11*7c478bd9Sstevel@tonic-gate #ifdef __STDC__
12*7c478bd9Sstevel@tonic-gate #include <stdarg.h>
13*7c478bd9Sstevel@tonic-gate #define VARARGS(func,type,arg) func(type arg, ...)
14*7c478bd9Sstevel@tonic-gate #define VASTART(ap,type,name)  va_start(ap,name)
15*7c478bd9Sstevel@tonic-gate #define VAEND(ap)              va_end(ap)
16*7c478bd9Sstevel@tonic-gate #else
17*7c478bd9Sstevel@tonic-gate #include <varargs.h>
18*7c478bd9Sstevel@tonic-gate #define VARARGS(func,type,arg) func(va_alist) va_dcl
19*7c478bd9Sstevel@tonic-gate #define VASTART(ap,type,name)  {type name; va_start(ap); name = va_arg(ap, type)
20*7c478bd9Sstevel@tonic-gate #define VAEND(ap)              va_end(ap);}
21*7c478bd9Sstevel@tonic-gate #endif
22*7c478bd9Sstevel@tonic-gate 
23*7c478bd9Sstevel@tonic-gate extern char *percent_m();
24