#ifndef __STDARG_LOADED #define __STDARG_LOADED 1 #ifndef __STDARG_PROCESSED #define __STDARG_PROCESSED /**************************************************************************** ** ** - Variable Arguments ** ***************************************************************************** ** Header introduced by the ANSI C Standard ***************************************************************************** */ /* ************************************************************************* */ /* * * */ /* * 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 2019-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 VARARGS.H. */ #ifdef __VARARGS_LOADED # pragma message ("Mixing of stdarg.h and varargs.h may yield incorrect behavior") # undef __VARARGS_LOADED # undef va_dcl # undef va_count # undef va_start_1 # undef va_start # undef va_arg # undef va_end #endif #ifdef __NAMESPACE_STD namespace std { #endif /* ** Declare a va_list */ #ifndef __VA_LIST # define __VA_LIST # if defined(__clang__) typedef __builtin_va_list va_list; # else typedef __va_list va_list; # endif #endif #ifdef __NAMESPACE_STD } /* namespace std */ #endif #if !defined(__x86_64) /* Verified for x86, John Reagan */ #if __X_FLOAT # define va_start(ap, parmN) \ ap = (__va_list) ((__char_ptr32) __VA_START_BUILTIN(parmN) + \ (((__IS_X_FLOAT_BUILTIN(parmN) ? sizeof(long double *) : sizeof(parmN)) + 7) & ~7)) # 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 /* 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_start(ap, parmN) \ ap = (__va_list) ((__char_ptr32) __VA_START_BUILTIN(parmN) + ((sizeof (parmN) + 7) & ~7)) # 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 #if defined(__DECC) && (__DECC_VER >= 70500000) #define va_copy(cp, ap) cp = (__va_list) ((__char_ptr32) __VA_COPY_BUILTIN(ap)) #endif #endif /* ** x86-64 support */ #if defined(__x86_64) /* Verified for x86, John Reagan */ # if defined(__clang__) # define va_start(ap, param) __builtin_va_start(ap, param) # define va_end(ap) __builtin_va_end(ap) # define va_arg(ap, type) __builtin_va_arg(ap, type) # define __va_copy(dest, src) __builtin_va_copy(dest, src) # define va_count(count) (count = __builtin_va_count()) # if __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L || !defined(__STRICT_ANSI__) # define va_copy(dest, src) __builtin_va_copy(dest, src) # endif # else # define va_start(ap, parmN) ap = __VA_START_BUILTIN(parmN) # define va_end(ap) __VA_END_BUILTIN(ap) # define va_arg(ap, type) __VA_ARG_BUILTIN(ap, type) # if !defined (__DECCXX) # define va_copy(cp, ap) cp = __VA_COPY_BUILTIN(ap) # endif # endif #endif /* ** common for all platforms */ /* ** va_count is an extension to the standard. */ #if !defined(__HIDE_FORBIDDEN_NAMES) && !defined (__clang__) unsigned int __VA_COUNT_BUILTIN(void); # define va_count(count) (count = __VA_COUNT_BUILTIN()) #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __STDARG_PROCESSED */ #if defined(__NAMESPACE_STD) && !defined(__NAMESPACE_STD_ONLY) # ifndef __USING_STDARG_NAMES # define __USING_STDARG_NAMES using std::va_list; # endif #endif #endif /* __STDARG_LOADED */