xref: /titanic_52/usr/src/lib/libwrap/mystdarg.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
6*7c478bd9Sstevel@tonic-gate 
7*7c478bd9Sstevel@tonic-gate 
8*7c478bd9Sstevel@tonic-gate  /*
9*7c478bd9Sstevel@tonic-gate   * What follows is an attempt to unify varargs.h and stdarg.h. I'd rather
10*7c478bd9Sstevel@tonic-gate   * have this than #ifdefs all over the code.
11*7c478bd9Sstevel@tonic-gate   */
12*7c478bd9Sstevel@tonic-gate 
13*7c478bd9Sstevel@tonic-gate #ifdef __STDC__
14*7c478bd9Sstevel@tonic-gate #include <stdarg.h>
15*7c478bd9Sstevel@tonic-gate #define VARARGS(func,type,arg) func(type arg, ...)
16*7c478bd9Sstevel@tonic-gate #define VASTART(ap,type,name)  va_start(ap,name)
17*7c478bd9Sstevel@tonic-gate #define VAEND(ap)              va_end(ap)
18*7c478bd9Sstevel@tonic-gate #else
19*7c478bd9Sstevel@tonic-gate #include <varargs.h>
20*7c478bd9Sstevel@tonic-gate #define VARARGS(func,type,arg) func(va_alist) va_dcl
21*7c478bd9Sstevel@tonic-gate #define VASTART(ap,type,name)  {type name; va_start(ap); name = va_arg(ap, type)
22*7c478bd9Sstevel@tonic-gate #define VAEND(ap)              va_end(ap);}
23*7c478bd9Sstevel@tonic-gate #endif
24*7c478bd9Sstevel@tonic-gate 
25*7c478bd9Sstevel@tonic-gate extern char *percent_m();
26