|
|
1.1 root 1: /* This is just like the default gvarargs.h
2: except for differences decribed below. */
3:
4: /* Make this a macro rather than a typedef, so we can undef any other defn. */
5: #define va_list __va___list
6: /* This has to be a char * to be compatible with Sun.
7: i.e., we have to pass a `va_list' to vsprintf. */
8: typedef char * __va___list;
9:
10: /* In GCC version 2, we want an ellipsis at the end of the declaration
11: of the argument list. GCC version 1 can't parse it. */
12:
13: #if __GNUC__ > 1
14: #define __va_ellipsis ...
15: #else
16: #define __va_ellipsis
17: #endif
18:
19: #define va_alist __builtin_va_alist
20: /* The ... causes current_function_varargs to be set in cc1. */
21: #define va_dcl int __builtin_va_alist; __va_ellipsis
22:
1.1.1.2 ! root 23: #ifdef _STDARG_H
! 24: #define va_start(AP, LASTARG) \
! 25: (__builtin_saveregs (), AP = ((char *) __builtin_next_arg ()))
! 26: #else
1.1 root 27: #define va_start(AP) \
28: (__builtin_saveregs (), (AP) = ((char *) &__builtin_va_alist))
1.1.1.2 ! root 29: #endif
! 30:
1.1 root 31: #define va_end(pvar)
32:
33: #define __va_rounded_size(TYPE) \
34: (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
35:
36: /* Avoid errors if compiling GCC v2 with GCC v1. */
37: #if __GNUC__ == 1
38: #define __extension__
39: #endif
40:
41: /* RECORD_TYPE args passed using the C calling convention are
42: passed by invisible reference. ??? RECORD_TYPE args passed
43: in the stack are made to be word-aligned; for an aggregate that is
44: not word-aligned, we advance the pointer to the first non-reg slot. */
45: #define va_arg(pvar,TYPE) \
46: __extension__ \
47: ({ TYPE __va_temp; \
48: ((__builtin_classify_type (__va_temp) >= 12) \
49: ? ((pvar) += __va_rounded_size (TYPE *), \
1.1.1.2 ! root 50: **(TYPE **) ((pvar) - __va_rounded_size (TYPE *))) \
! 51: : ((pvar) += __va_rounded_size (TYPE), \
1.1 root 52: *((TYPE *) ((pvar) - __va_rounded_size (TYPE)))));})
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.