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 #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
25 #ifdef __sparc__
26 #include "va-sparc.h"
27 #else
28 #ifdef __i960__
29 #include "va-i960.h"
30 #else
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
42 typedef char *va_list;
43 #endif /* _VA_LIST */
44 #endif /* _VA_LIST_ */
45
46 /* Amount of space required in an argument list for an arg of type TYPE.
47    TYPE may alternatively be an expression whose type is used.  */
48
49 #define __va_rounded_size(TYPE)  \
50   (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
51
52 #define va_start(AP, LASTARG)                                           \
53  (AP = ((char *) __builtin_next_arg ()))
54
55 void va_end (va_list);          /* Defined in libgcc.a */
56 #define va_end(AP)
57
58 #define va_arg(AP, TYPE)                                                \
59  (AP += __va_rounded_size (TYPE),                                       \
60   *((TYPE *) (AP - __va_rounded_size (TYPE))))
61
62 #endif /* not i960 */
63 #endif /* not sparc */
64 #endif /* not mips */
65 #endif /* not hp9000s800 */
66 #endif /* not i860 */
67 #endif /* not m88k */
68 #endif /* __GNUC__ */
69 #endif /* _STDARG_H */