#ifndef __VARARGS_LOADED #define __VARARGS_LOADED /**************************************************************************** ** ** - variable length argument lists ** ***************************************************************************** ** Header introduced by the X/Open CAE Specification, Issue 4 ***************************************************************************** ** ** Copyright 2003 Hewlett-Packard Development Company, L.P. ** ** Confidential computer software. Valid license from HP and/or ** its subsidiaries 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. ** ** Neither HP nor any of its subsidiaries shall be liable for technical ** or editorial errors or omissions contained herein. The information ** in this document is provided "as is" without warranty of any kind and ** is subject to change without notice. The warranties for HP products ** are set forth in the express limited warranty statements accompanying ** such products. Nothing herein should be construed as constituting an ** additional warranty. ** ***************************************************************************** */ #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 __STDARG_PROCESSED # undef va_start # undef va_arg # undef va_end #endif /* ** Declare a va_list */ #ifndef __VA_LIST # define __VA_LIST #ifdef __NAMESPACE_STD namespace std { #endif typedef __va_list va_list; #ifdef __NAMESPACE_STD } /* namespace std */ using std::va_list; #endif #endif #define va_dcl int va_alist; #if !defined(__VAX) # define va_start_1(ap, offset) \ ap = (__va_list) ((__char_ptr32) __VA_START_BUILTIN(va_alist) + (offset)) # define va_start(ap) \ ap = (__va_list) __VA_START_BUILTIN(va_alist) # if __X_FLOAT # if defined(__va_arg_no_comma) || (defined(__cplusplus) && defined(__ia64)) /* Linux-style definition of va_arg, without comma operator */ # define va_arg(ap, type) (__IS_X_FLOAT_BUILTIN(type) ? \ (* ((type **) \ ((__char_ptr32)(ap = (__va_list) ((__char_ptr32) ap + \ ((sizeof(long double *) + 7) & ~7))) - \ ((sizeof(long double *) + 7) & ~7)))[0]) \ : \ ( ((type *) \ ((__char_ptr32)(ap = (__va_list) ((__char_ptr32) ap + \ ((sizeof(type) + 7) & ~7))) - \ ((sizeof(type) + 7) & ~7)))[0]) \ ) # else /* VMS-style definition of va_arg, using comma operator */ # define va_arg(ap, type) (\ ap = (__va_list) ((__char_ptr32) ap + \ (((__IS_X_FLOAT_BUILTIN(type) ? sizeof(long double *) : sizeof(type)) + 7) & ~7)), \ __IS_X_FLOAT_BUILTIN(type) ? \ (** (type **)((__char_ptr32) ap - \ (((__IS_X_FLOAT_BUILTIN(type) ? sizeof(long double *) : sizeof(type)) + 7) & ~7))) : \ ( * (type *)((__char_ptr32) ap - \ (((__IS_X_FLOAT_BUILTIN(type) ? sizeof(long double *) : sizeof(type)) + 7) & ~7))) ) # endif # else # define va_arg(ap, type) (\ ap = (__va_list) ((__char_ptr32) ap + ((sizeof (type) + 7) & ~7)), \ (* (type *)((__char_ptr32) 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_ptr32) &va_alist + (offset)) # define va_start(ap) \ ap = (__va_list) &va_alist # define va_arg(ap, type) (\ ap = (__va_list) ((__char_ptr32) ap + ((sizeof (type) + 3) & ~3)), \ * (type *) ((__char_ptr32) 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_ptr32) &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_ptr32) ap + ((sizeof (type) + 3) & ~3)), \ * (type *) ((__char_ptr32) ap - ((sizeof (type) + 3) & ~3)))) # endif #endif #define va_end(ap) ap = (__va_list) 0 /* ** DEC C extensions */ #ifndef _XOPEN_SOURCE # if !defined(__VAX) 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 */