#if defined (__clang__) #error "Do not use header. Use instead." #else #ifndef __VARARGS_LOADED #define __VARARGS_LOADED /**************************************************************************** ** ** - variable length argument lists ** ***************************************************************************** ** Header introduced by the X/Open CAE Specification, Issue 4 ***************************************************************************** */ /* ************************************************************************* */ /* * * */ /* * HPE CONFIDENTIAL. This software is confidential proprietary software * */ /* * licensed by Hewlett Packard Enterprise Development, LP, and is not * */ /* * authorized to be used, duplicated or disclosed to anyone without the * */ /* * prior written permission of HPE. * */ /* * Copyright 2017 Hewlett Packard Enterprise Development, LP * */ /* * * */ /* * VMS SOFTWARE, INC. CONFIDENTIAL. This software is confidential * */ /* * proprietary software licensed by VMS Software, Inc., and is not * */ /* * authorized to be used, duplicated or disclosed to anyone without * */ /* * the prior written permission of VMS Software, Inc. * */ /* * Copyright 2017-2022 VMS Software, Inc. * */ /* * * */ /* ************************************************************************* */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif /* ** The header files VARARGS.H and STDARG.H cannot be used together; undo the ** effects of STDARG.H. */ #ifdef __STDARG_LOADED # pragma message ("Mixing of stdarg.h and varargs.h may yield incorrect behavior") # 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 #if defined(__x86_64) /* Verified for x86, John Reagan */ #define va_dcl int va_alist; #define va_start(ap) ap = __VA_START_BUILTIN(va_alist) #define va_end(ap) __VA_END_BUILTIN(ap) #define va_arg(ap,type) __VA_ARG_BUILTIN(ap,type) #else #define va_dcl int va_alist; #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)) /* Verified for x86, John Reagan */ /* 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 /* defined(__va_arg_no_comma) || (defined(__cplusplus) && defined(__ia64)) */ /* 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 /* defined(__va_arg_no_comma) || (defined(__cplusplus) && defined(__ia64)) */ #else /* __X_FLOAT */ # define va_arg(ap, type) (\ ap = (__va_list) ((__char_ptr32) ap + ((sizeof (type) + 7) & ~7)), \ (* (type *)((__char_ptr32) ap - ((sizeof (type) + 7) & ~7)))) #endif /* __X_FLOAT */ #define va_end(ap) ap = (__va_list) 0 #endif /* ** DEC C extensions */ #ifndef _XOPEN_SOURCE unsigned int __VA_COUNT_BUILTIN(void); # define va_count(count) (count = __VA_COUNT_BUILTIN()) #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __VARARGS_LOADED */ #endif /* __clang__ */