2017-10-21 23:40:19 +00:00
|
|
|
/****************************************************************
|
|
|
|
*
|
|
|
|
* stdarg.h - variable length parameter list handling
|
|
|
|
*
|
|
|
|
* February 1989
|
|
|
|
* Mike Westerfield
|
|
|
|
*
|
|
|
|
* Copyright 1989
|
|
|
|
* Byte Works, Inc.
|
|
|
|
*
|
|
|
|
*****************************************************************
|
|
|
|
*
|
|
|
|
* Modified July 1994
|
|
|
|
*
|
|
|
|
* Thanks to Doug Gwyn for the new va_start & va_arg declarations.
|
|
|
|
*
|
2021-10-24 02:18:09 +00:00
|
|
|
*****************************************************************
|
|
|
|
*
|
|
|
|
* Modified October 2021 for better standards conformance.
|
|
|
|
* This version will only work with ORCA/C 2.2.0 B6 or later.
|
|
|
|
*
|
2017-10-21 23:40:19 +00:00
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
#ifndef __stdarg__
|
|
|
|
#define __stdarg__
|
|
|
|
|
|
|
|
#ifndef __va_list__
|
|
|
|
#define __va_list__
|
|
|
|
typedef char *__va_list[2];
|
|
|
|
#endif
|
|
|
|
|
2018-08-28 23:58:27 +00:00
|
|
|
typedef __va_list va_list;
|
2021-10-24 02:18:09 +00:00
|
|
|
#define va_end(ap) __record_va_info(ap)
|
2024-09-14 20:24:53 +00:00
|
|
|
#if !defined(__KeepNamespacePure__) || __STDC_VERSION__ >= 202311L
|
2024-08-31 02:24:48 +00:00
|
|
|
#define va_start(ap,...) ((void) ((ap)[0] = (char *)__orcac_va_info[1], (ap)[1] = (char *)&__orcac_va_info))
|
|
|
|
#else
|
2022-12-09 01:15:53 +00:00
|
|
|
#define va_start(ap,LastFixedParm) ((void) ((ap)[0] = (char *)__orcac_va_info[1], (ap)[1] = (char *)&__orcac_va_info))
|
2024-08-31 02:24:48 +00:00
|
|
|
#endif
|
2021-10-24 02:18:09 +00:00
|
|
|
#define va_arg(ap,type) _Generic(*(type *)0, \
|
2021-09-04 02:25:20 +00:00
|
|
|
double: (type)((long double *)((ap)[0] += sizeof(long double)))[-1], \
|
|
|
|
default: ((type *)((ap)[0] += sizeof(type)))[-1])
|
2021-10-24 03:36:53 +00:00
|
|
|
#define va_copy(dest,src) ((void)((dest)[0]=(src)[0],(dest)[1]=(src)[1]))
|
2017-10-21 23:40:19 +00:00
|
|
|
|
2021-10-24 02:18:09 +00:00
|
|
|
void __record_va_info(va_list);
|
2017-10-21 23:40:19 +00:00
|
|
|
|
|
|
|
#endif
|