Commit a20dcf46 by Jim Wilson

(va_start): Add call to builtin_next_arg.

From-SVN: r6856
parent 117aea7a
......@@ -35,8 +35,11 @@ typedef struct {
/* ANSI alternative. */
/* Call __builtin_next_arg even though we aren't using its value, so that
we can verify that firstarg is correct. */
#define va_start(pvar, firstarg) \
((pvar) = *(__gnuc_va_list *) __builtin_saveregs ())
(__builtin_next_arg (firstarg), \
(pvar) = *(__gnuc_va_list *) __builtin_saveregs ())
#endif /* _STDARG_H */
......
......@@ -22,9 +22,12 @@ typedef struct
#define _VA_LIST_
#define _SYS_INT_STDARG_H /* acc compatibility */
/* Call __builtin_next_arg even though we aren't using its value, so that
we can verify that LASTARG is correct. */
#ifdef _STDARG_H
#define va_start(AP,LASTARG) \
((AP) = *(va_list *)__builtin_saveregs(), \
(__builtin_next_arg (LASTARG), \
(AP) = *(va_list *)__builtin_saveregs(), \
(AP).__va_num = __builtin_args_info (0), \
(AP).__va_ap += __builtin_args_info (1))
#else
......
......@@ -19,8 +19,12 @@ typedef struct
#ifdef _STDARG_H /* stdarg.h support */
/* Call __builtin_next_arg even though we aren't using its value, so that
we can verify that LASTARG is correct. */
#if __GNUC__ > 1 /* GCC 2.0 and beyond */
#define va_start(AP,LASTARG) ((AP) = *(__gnuc_va_list *)__builtin_saveregs())
#define va_start(AP,LASTARG) \
(__builtin_next_arg (LASTARG), \
(AP) = *(__gnuc_va_list *)__builtin_saveregs())
#else
#define va_start(AP,LASTARG) \
( (AP).__va_reg = (int *) __builtin_saveregs2(0), \
......
......@@ -21,8 +21,11 @@ typedef double *__gnuc_va_list;
(AP) = (double *)((char *)(AP) + 4)
#endif /* __GNUC__ > 1 */
/* Call __builtin_next_arg even though we aren't using its value, so that
we can verify that LASTARG is correct. */
#ifdef _STDARG_H
#define va_start(AP,LASTARG) __gnuc_va_start (AP)
#define va_start(AP,LASTARG) \
(__builtin_next_arg (LASTARG), __gnuc_va_start (AP))
#else
/* The ... causes current_function_varargs to be set in cc1. */
#define va_dcl long va_alist; __va_ellipsis
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment