OSDN Git Service

*** empty log message ***
[pf3gnuchains/gcc-fork.git] / gcc / ginclude / stdarg.h
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 #ifdef __m88k__
10 #include "va-m88k.h"
11 #else
12 #ifdef __i860__
13 #include "va-i860.h"
14 #else
15 #ifdef __hp9000s800__
16 #include "va-hp800.h"
17 #else
18 #ifdef __mips__
19 #include "va-mips.h"
20 #else
21
22 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.  */
23 #ifndef _VA_LIST_
24 /* The macro _VA_LIST is used in SCO Unix 3.2.  */
25 #ifndef _VA_LIST
26 #define _VA_LIST_
27 #define _VA_LIST
28 typedef char *va_list;
29 #endif /* _VA_LIST */
30 #endif /* _VA_LIST_ */
31
32 /* Amount of space required in an argument list for an arg of type TYPE.
33    TYPE may alternatively be an expression whose type is used.  */
34
35 #define __va_rounded_size(TYPE)  \
36   (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
37
38 #ifndef __sparc__
39 #define va_start(AP, LASTARG)                                           \
40  (AP = ((char *) __builtin_next_arg ()))
41 #else
42 #define va_start(AP, LASTARG)                                           \
43  (__builtin_saveregs (),                                                \
44   AP = ((char *) __builtin_next_arg ()))
45 #endif
46
47 void va_end (va_list);          /* Defined in libgcc.a */
48 #define va_end(AP)
49
50 #define va_arg(AP, TYPE)                                                \
51  (AP += __va_rounded_size (TYPE),                                       \
52   *((TYPE *) (AP - __va_rounded_size (TYPE))))
53
54 #endif /* not mips */
55 #endif /* not hp9000s800 */
56 #endif /* not i860 */
57 #endif /* not m88k */
58 #endif /* _STDARG_H */