OSDN Git Service

Call va-alpha.h for Alpha.
[pf3gnuchains/gcc-fork.git] / gcc / ginclude / varargs.h
1 #ifndef __GNUC__
2 /* Use the system's macros with the system's compiler.  */
3 #include <varargs.h>
4 #else
5 /* Record that varargs.h is defined; this turns off stdarg.h.  */
6
7 #ifndef _VARARGS_H
8 #define _VARARGS_H
9
10 #ifdef __sparc__
11 #include "va-sparc.h"
12 #else
13 #ifdef __spur__
14 #include "va-spur.h"
15 #else
16 #ifdef __mips__
17 #include "va-mips.h"
18 #else
19 #ifdef __i860__
20 #include "va-i860.h"
21 #else
22 #ifdef __pyr__
23 #include "va-pyr.h"
24 #else
25 #ifdef __m88k__
26 #include "va-m88k.h"
27 #else
28 #if defined(__hppa__) || defined(hp800)
29 #include "va-pa.h"
30 #else
31 #ifdef __i960__
32 #include "va-i960.h"
33 #else
34 #ifdef __alpha__
35 #include "va-alpha.h"
36 #else
37
38 #ifdef __NeXT__
39
40 /* On Next, erase any vestiges of stdarg.h.  */
41
42 #undef va_alist
43 #undef va_dcl
44 #undef va_list
45 #undef va_start
46 #undef va_end
47 #undef __va_rounded_size
48 #undef va_arg
49 #endif  /* __NeXT__ */
50
51 /* In GCC version 2, we want an ellipsis at the end of the declaration
52    of the argument list.  GCC version 1 can't parse it.  */
53
54 #if __GNUC__ > 1
55 #define __va_ellipsis ...
56 #else
57 #define __va_ellipsis
58 #endif
59
60 /* These macros implement traditional (non-ANSI) varargs
61    for GNU C.  */
62
63 #define va_alist  __builtin_va_alist
64 /* The ... causes current_function_varargs to be set in cc1.  */
65 #define va_dcl    int __builtin_va_alist; __va_ellipsis
66
67 #ifdef _HIDDEN_VA_LIST  /* On OSF1, this means varargs.h is "half-loaded".  */
68 #undef _VA_LIST
69 #endif
70
71 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.  */
72 /* But in 4.3bsd-net2, _VA_LIST_ has another meaning.  So ignore it.  */
73 #if !defined (_VA_LIST_) || defined (_ANSI_H)
74 /* The macro _VA_LIST is used in SCO Unix 3.2.  */
75 #ifndef _VA_LIST
76 #ifndef _VA_LIST_
77 #define _VA_LIST_
78 #endif
79 #define _VA_LIST
80 /* Make this a macro rather than a typedef, so we can undef any other defn.  */
81 #define va_list __va___list
82 typedef char * __va___list;
83 #endif /* _VA_LIST */
84 #endif /* !defined (_VA_LIST_) || defined (_ANSI_H) */
85
86 /*  In 4.3bsd-net2, it is said we must #undef this.
87     I hope this successfully identifies that system.
88     I don't know why this works--rms.  */
89 #ifdef _ANSI_H_
90 #undef _VA_LIST_
91 #endif
92
93 #define va_start(AP)  AP=(char *) &__builtin_va_alist
94
95 #define va_end(AP)
96
97 #define __va_rounded_size(TYPE)  \
98   (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
99
100 #define va_arg(AP, TYPE)                                                \
101  (AP += __va_rounded_size (TYPE),                                       \
102   *((TYPE *) (AP - __va_rounded_size (TYPE))))
103
104 #endif /* not alpha */
105 #endif /* not i960 */
106 #endif /* not hppa */
107 #endif /* not m88k */
108 #endif /* not pyr */
109 #endif /* not i860 */
110 #endif /* not mips */
111 #endif /* not spur */
112 #endif /* not sparc */
113 #endif /* not _VARARGS_H */
114
115 #ifdef __GNUC_VA_LIST
116 /* If an include file defined __GNUC_VA_LIST,
117    copy it into va_list.  */
118
119 #ifdef _HIDDEN_VA_LIST  /* On OSF1, this means varargs.h is "half-loaded".  */
120 #undef _VA_LIST
121 #endif
122
123 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.  */
124 #ifndef _VA_LIST_
125 /* The macro _VA_LIST is used in SCO Unix 3.2.  */
126 #ifndef _VA_LIST
127 #define _VA_LIST_
128 #define _VA_LIST
129 typedef __gnuc_va_list va_list;
130 #endif /* _VA_LIST */
131 #endif /* _VA_LIST_ */
132 #endif /* __GNUC_VA_LIST */
133
134 #endif /* __GNUC__ */