source: trunk/third/gcc/ginclude/va-mn10300.h @ 11288

Revision 11288, 1.2 KB checked in by ghudson, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r11287, which included commits to RCS files with non-trunk default branches.
Line 
1/* Define __gnuc_va_list. */
2
3#ifndef __GNUC_VA_LIST
4#define __GNUC_VA_LIST
5typedef void *__gnuc_va_list;
6#endif /* not __GNUC_VA_LIST */
7
8/* If this is for internal libc use, don't define anything but
9   __gnuc_va_list.  */
10#if defined (_STDARG_H) || defined (_VARARGS_H)
11#define __gnuc_va_start(AP) (AP = (__gnuc_va_list)__builtin_saveregs())
12#define __va_ellipsis ...
13
14#ifdef _STDARG_H
15#define va_start(AP, LASTARG) \
16  (__builtin_next_arg (LASTARG), __gnuc_va_start (AP))
17#else
18#define va_alist __builtin_va_alist
19#define va_dcl int __builtin_va_alist; __va_ellipsis
20#define va_start(AP)  AP=(char *) &__builtin_va_alist
21#endif
22
23/* Now stuff common to both varargs & stdarg implementations.  */
24#define __va_rounded_size(TYPE)                                         \
25  (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
26#undef va_end
27void va_end (__gnuc_va_list);
28#define va_end(AP) ((void)0)
29#define va_arg(AP, TYPE)                                                \
30 (sizeof (TYPE) > 8                                                     \
31  ? (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (char *)),\
32    **((TYPE **) (void *) ((char *) (AP) - __va_rounded_size (char *))))\
33  : (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)),  \
34    *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))))
35#endif
Note: See TracBrowser for help on using the repository browser.