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