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 #ifndef __need___va_list
8 #define _STDARG_H
9 #endif
10 #undef __need___va_list
11
12 #ifndef __GNUC__
13 /* Use the system's macros with the system's compiler.  */
14 #include <stdarg.h>
15 #else
16 #ifdef __m88k__
17 #include "va-m88k.h"
18 #else
19 #ifdef __i860__
20 #include "va-i860.h"
21 #else
22 #ifdef __hp9000s800__
23 #include "va-hp800.h"
24 #else
25 #ifdef __mips__
26 #include "va-mips.h"
27 #else
28 #ifdef __sparc__
29 #include "va-sparc.h"
30 #else
31 #ifdef __i960__
32 #include "va-i960.h"
33 #else
34
35 /* Define __gnuc_va_list.  */
36
37 #ifndef __GNUC_VA_LIST
38 #define __GNUC_VA_LIST
39 #ifdef __svr4__
40 typedef char *__gnuc_va_list;
41 #else
42 typedef void *__gnuc_va_list;
43 #endif
44 #endif
45
46 /* Define the standard macros for the user,
47    if this invocation was from the user program.  */
48 #ifdef __STDARG_H
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 (__gnuc_va_list);           /* Defined in libgcc.a */
60 #define va_end(AP)
61
62 #define va_arg(AP, TYPE)                                                \
63  (AP = ((char *) (AP)) += __va_rounded_size (TYPE),                     \
64   *((TYPE *) ((char *) (AP) - __va_rounded_size (TYPE))))
65 #endif /* _STDARG_H */
66
67 #endif /* not i960 */
68 #endif /* not sparc */
69 #endif /* not mips */
70 #endif /* not hp9000s800 */
71 #endif /* not i860 */
72 #endif /* not m88k */
73
74 #ifdef _STDARG_H
75 /* Define va_list, if desired, from __gnuc_va_list. */
76
77 #ifdef _HIDDEN_VA_LIST  /* On OSF1, this means varargs.h is "half-loaded".  */
78 #undef _VA_LIST
79 #endif
80
81 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.  */
82 #ifndef _VA_LIST_
83 /* The macro _VA_LIST is used in SCO Unix 3.2.  */
84 #ifndef _VA_LIST
85 #define _VA_LIST_
86 #define _VA_LIST
87 typedef __gnuc_va_list va_list;
88 #endif /* _VA_LIST */
89 #endif /* _VA_LIST_ */
90 #endif /* _STDARG_H */
91
92 #endif /* __GNUC__ */
93 #endif /* not _STDARG_H */