Commit a36dc548 by Jim Wilson

(va_start): Rewrite to account for builtin_saveregs changes.

From-SVN: r3339
parent 9a1c7cd7
...@@ -21,25 +21,16 @@ typedef void * __gnuc_va_list; ...@@ -21,25 +21,16 @@ typedef void * __gnuc_va_list;
__gnuc_va_list. */ __gnuc_va_list. */
#if defined (_STDARG_H) || defined (_VARARGS_H) #if defined (_STDARG_H) || defined (_VARARGS_H)
/* In GCC version 2, we want an ellipsis at the end of the declaration #ifdef _STDARG_H
of the argument list. GCC version 1 can't parse it. */
#if __GNUC__ > 1 #define va_start(AP, LASTARG) (AP = (char *) __builtin_saveregs ())
#define __va_ellipsis ...
#else
#define __va_ellipsis
#endif
#ifdef _STDARG_H
#define va_start(AP, LASTARG) \
(__builtin_saveregs (), AP = ((char *) __builtin_next_arg ()))
#else #else
#define va_alist __builtin_va_alist #define va_alist __builtin_va_alist
/* The ... causes current_function_varargs to be set in cc1. */ #define va_dcl
#define va_dcl int __builtin_va_alist; __va_ellipsis #define va_start(AP) ((AP) = (char *) __builtin_saveregs ())
#define va_start(AP) \
(__builtin_saveregs (), (AP) = ((char *) &__builtin_va_alist))
#endif #endif
#ifndef va_end #ifndef va_end
......
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