|
|
1.1 root 1: /* stdarg.h for GNU.
2: Note that the type used in va_arg is supposed to match the
3: actual type **after default promotions**.
4: Thus, va_arg (..., short) is not valid. */
5:
6: #ifndef _STDARG_H
7: #define _STDARG_H
8:
9: #ifndef __GNUC__
10: /* Use the system's macros with the system's compiler. */
11: #include <stdarg.h>
12: #else
13: #ifdef __m88k__
14: #include "va-m88k.h"
15: #else
16: #ifdef __i860__
17: #include "va-i860.h"
18: #else
19: #ifdef __hp9000s800__
20: #include "va-hp800.h"
21: #else
22: #ifdef __mips__
23: #include "va-mips.h"
24: #else
1.1.1.2 root 25: #ifdef __sparc__
26: #include "va-sparc.h"
27: #else
1.1.1.3 ! root 28: #ifdef __i960__
! 29: #include "va-i960.h"
! 30: #else
1.1 root 31:
32: #ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
33: #undef _VA_LIST
34: #endif
35:
36: /* The macro _VA_LIST_ is the same thing used by this file in Ultrix. */
37: #ifndef _VA_LIST_
38: /* The macro _VA_LIST is used in SCO Unix 3.2. */
39: #ifndef _VA_LIST
40: #define _VA_LIST_
41: #define _VA_LIST
1.1.1.3 ! root 42: #ifndef __svr4__
1.1 root 43: typedef char *va_list;
1.1.1.3 ! root 44: #else
! 45: typedef void *va_list;
! 46: #endif
1.1 root 47: #endif /* _VA_LIST */
48: #endif /* _VA_LIST_ */
49:
50: /* Amount of space required in an argument list for an arg of type TYPE.
51: TYPE may alternatively be an expression whose type is used. */
52:
53: #define __va_rounded_size(TYPE) \
54: (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
55:
56: #define va_start(AP, LASTARG) \
57: (AP = ((char *) __builtin_next_arg ()))
58:
59: void va_end (va_list); /* Defined in libgcc.a */
60: #define va_end(AP)
61:
62: #define va_arg(AP, TYPE) \
1.1.1.3 ! root 63: (AP = ((char *) (AP)) += __va_rounded_size (TYPE), \
! 64: *((TYPE *) ((char *) (AP) - __va_rounded_size (TYPE))))
1.1 root 65:
1.1.1.3 ! root 66: #endif /* not i960 */
1.1.1.2 root 67: #endif /* not sparc */
1.1 root 68: #endif /* not mips */
69: #endif /* not hp9000s800 */
70: #endif /* not i860 */
71: #endif /* not m88k */
72: #endif /* __GNUC__ */
73: #endif /* _STDARG_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.