mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-02-06 04:30:13 +00:00
Change va_start to not depend on the last fixed argument.
This is necessary to work correctly if the last fixed argument is of type double and #pragma extensions bit 1 is clear. It will also be necessary for C23, where va_start does not require the LastFixedParm argument. (For now, however, we stick with the pre-C23 definition of va_start where that argument needs to be supplied, even though it is now ignored.)
This commit is contained in:
parent
fb5a2fcf33
commit
6ba6ad549f
@ -31,7 +31,7 @@ typedef char *__va_list[2];
|
||||
|
||||
typedef __va_list va_list;
|
||||
#define va_end(ap) __record_va_info(ap)
|
||||
#define va_start(ap,LastFixedParm) ((void) ((ap)[0] = (char *) (&LastFixedParm + 1), (ap)[1] = (char *)&__orcac_va_info))
|
||||
#define va_start(ap,LastFixedParm) ((void) ((ap)[0] = (char *)__orcac_va_info[1], (ap)[1] = (char *)&__orcac_va_info))
|
||||
#define va_arg(ap,type) _Generic(*(type *)0, \
|
||||
double: (type)((long double *)((ap)[0] += sizeof(long double)))[-1], \
|
||||
default: ((type *)((ap)[0] += sizeof(type)))[-1])
|
||||
|
Loading…
x
Reference in New Issue
Block a user