#ifndef __VARARGS_LOADED #define __VARARGS_LOADED /**************************************************************************** ** ** - variable length argument lists ** ***************************************************************************** ** Header introduced by the X/Open CAE Specification, Issue 4 ***************************************************************************** ** ** Copyright 2000 Compaq Computer Corporation ** ** Compaq and the Compaq logo Registered in U.S. Patent and Trademark Office. ** ** Confidential computer software. Valid license from Compaq required for ** possession, use or copying. Consistent with FAR 12.211 and 12.212, ** Commercial Computer Software, Computer Software Documentation, and ** Technical Data for Commercial Items are licensed to the U.S. Government ** under vendor's standard commercial license. ** ****************************************************************************** */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif /* ** The header files VARARGS.H and STDARG.H cannot be used together; undo the ** effects of VARARGS.H. */ #ifdef __STDARG_LOADED # undef __STDARG_LOADED # undef va_start # undef va_arg # undef va_end #endif /* ** Declare a va_list */ #ifndef __VA_LIST # define __VA_LIST typedef __va_list va_list; #endif #define va_dcl int va_alist; #ifdef __ALPHA # define va_start_1(ap, offset) ap = (__va_list) ((char *) __VA_START_BUILTIN(va_alist) + (offset)) # define va_start(ap) ap = (__va_list) __VA_START_BUILTIN(va_alist) # if __X_FLOAT # define va_arg(ap, type) \ (ap = (__va_list) ((char *) ap + \ (((__IS_X_FLOAT_BUILTIN(type) ? sizeof(long double *) : sizeof(type)) + 7) & ~7)), \ __IS_X_FLOAT_BUILTIN(type) ? \ (** (type **)((char *) ap - (((__IS_X_FLOAT_BUILTIN(type) ? sizeof(long double *) : sizeof(type)) + 7) & ~7))) : \ ( * (type *)((char *) ap - (((__IS_X_FLOAT_BUILTIN(type) ? sizeof(long double *) : sizeof(type)) + 7) & ~7))) ) # else # define va_arg(ap, type) (ap = (__va_list) ((char *) ap + ((sizeof (type) + 7) & ~7)), \ (* (type *)((char *) ap - ((sizeof (type) + 7) & ~7)))) # endif #else void decc$va_count( int *__count ); # if defined(__cplusplus) || !defined(__DECC) # define va_count(count) decc$va_count (&count) # define va_start_1(ap, offset) ap = (__va_list) ((char *) &va_alist + (offset)) # define va_start(ap) ap = (__va_list) &va_alist # define va_arg(ap, type) (ap = (__va_list) ((char *) ap + ((sizeof (type) + 3) & ~3)), \ * (type *) ((char *) ap - ((sizeof (type) + 3) & ~3))) # else # define va_count(count) (__VA_START_BUILTIN(), decc$va_count (&count)) # define va_start_1(ap, offset) ap = (__VA_START_BUILTIN(), \ (__va_list) ((char *) &va_alist + (offset))) # define va_start(ap) ap = (__VA_START_BUILTIN(),(__va_list) &va_alist) # define va_arg(ap, type) (__VA_START_BUILTIN(),(ap = (__va_list) ((char *) ap + ((sizeof (type) + 3) & ~3)), \ * (type *) ((char *) ap - ((sizeof (type) + 3) & ~3)))) # endif #endif #define va_end(ap) ap = (__va_list) 0 /* ** DEC C extensions */ #ifndef _XOPEN_SOURCE # ifdef __ALPHA unsigned int __VA_COUNT_BUILTIN(void); # define va_count(count) (count = __VA_COUNT_BUILTIN()) # else void decc$va_count( int *__count ); # if defined(__cplusplus) || !defined(__DECC) # define va_count(count) decc$va_count (&count) # else # define va_count(count) (__VA_START_BUILTIN(), decc$va_count (&count)) # endif # endif #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __VARARGS_LOADED */