|
|
1.1 root 1: #ifndef __GNUC__
2: /* Use the system's macros with the system's compiler. */
3: #include <varargs.h>
4: #else
1.1.1.3 root 5: /* Record that this is varargs.h; this turns off stdarg.h. */
1.1 root 6:
7: #ifndef _VARARGS_H
8: #define _VARARGS_H
9:
10: #ifdef __sparc__
1.1.1.3 root 11: #include <va-sparc.h>
1.1 root 12: #else
13: #ifdef __spur__
1.1.1.3 root 14: #include <va-spur.h>
1.1 root 15: #else
16: #ifdef __mips__
1.1.1.3 root 17: #include <va-mips.h>
1.1 root 18: #else
19: #ifdef __i860__
1.1.1.3 root 20: #include <va-i860.h>
1.1 root 21: #else
22: #ifdef __pyr__
1.1.1.3 root 23: #include <va-pyr.h>
1.1 root 24: #else
1.1.1.4 root 25: #ifdef __clipper__
26: #include <va-clipper.h>
27: #else
1.1 root 28: #ifdef __m88k__
1.1.1.3 root 29: #include <va-m88k.h>
1.1 root 30: #else
1.1.1.3 root 31: #if defined(__hppa__) || defined(hp800)
32: #include <va-pa.h>
1.1 root 33: #else
1.1.1.2 root 34: #ifdef __i960__
1.1.1.3 root 35: #include <va-i960.h>
36: #else
37: #ifdef __alpha__
38: #include <va-alpha.h>
1.1.1.2 root 39: #else
1.1.1.5 ! root 40: #if defined (__H8300__) || defined (__H8300H__)
! 41: #include <va-h8300.h>
! 42: #else
1.1 root 43:
44: #ifdef __NeXT__
45:
46: /* On Next, erase any vestiges of stdarg.h. */
47:
1.1.1.3 root 48: #ifdef _ANSI_STDARG_H_
49: #define _VA_LIST_
50: #endif
51: #define _ANSI_STDARG_H_
52:
1.1 root 53: #undef va_alist
54: #undef va_dcl
55: #undef va_list
56: #undef va_start
57: #undef va_end
58: #undef __va_rounded_size
59: #undef va_arg
60: #endif /* __NeXT__ */
61:
62: /* In GCC version 2, we want an ellipsis at the end of the declaration
63: of the argument list. GCC version 1 can't parse it. */
64:
65: #if __GNUC__ > 1
66: #define __va_ellipsis ...
67: #else
68: #define __va_ellipsis
69: #endif
70:
71: /* These macros implement traditional (non-ANSI) varargs
72: for GNU C. */
73:
74: #define va_alist __builtin_va_alist
75: /* The ... causes current_function_varargs to be set in cc1. */
76: #define va_dcl int __builtin_va_alist; __va_ellipsis
77:
1.1.1.3 root 78: /* Define __gnuc_va_list, just as in gstdarg.h. */
1.1 root 79:
1.1.1.3 root 80: #ifndef __GNUC_VA_LIST
81: #define __GNUC_VA_LIST
82: #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
83: typedef char *__gnuc_va_list;
84: #else
85: typedef void *__gnuc_va_list;
1.1 root 86: #endif
87: #endif
88:
89: #define va_start(AP) AP=(char *) &__builtin_va_alist
90:
91: #define va_end(AP)
92:
93: #define __va_rounded_size(TYPE) \
94: (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
95:
1.1.1.5 ! root 96: #if defined (__arm__) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__)
1.1.1.3 root 97: /* This is for little-endian machines; small args are padded upward. */
98: #define va_arg(AP, TYPE) \
99: (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
100: *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))
101: #else /* big-endian */
102: /* This is for big-endian machines; small args are padded downward. */
1.1 root 103: #define va_arg(AP, TYPE) \
1.1.1.3 root 104: (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
105: *((TYPE *) (void *) ((char *) (AP) - ((sizeof (TYPE) < 4 \
106: ? sizeof (TYPE) \
107: : __va_rounded_size (TYPE))))))
108: #endif /* big-endian */
1.1 root 109:
1.1.1.5 ! root 110: #endif /* not h8300 */
1.1.1.3 root 111: #endif /* not alpha */
1.1.1.2 root 112: #endif /* not i960 */
1.1.1.3 root 113: #endif /* not hppa */
1.1 root 114: #endif /* not m88k */
1.1.1.4 root 115: #endif /* not clipper */
1.1 root 116: #endif /* not pyr */
117: #endif /* not i860 */
118: #endif /* not mips */
119: #endif /* not spur */
120: #endif /* not sparc */
121: #endif /* not _VARARGS_H */
1.1.1.3 root 122:
123: /* Define va_list from __gnuc_va_list. */
124:
125: #ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
126: #undef _VA_LIST
127: #endif
128:
1.1.1.4 root 129: #ifdef __svr4__
1.1.1.3 root 130: /* SVR4.2 uses _VA_LIST for an internal alias for va_list,
1.1.1.4 root 131: so we must avoid testing it and setting it here.
132: SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
133: have no conflict with that. */
1.1.1.3 root 134: #ifndef _VA_LIST_
135: #define _VA_LIST_
1.1.1.4 root 136: #ifdef __i860__
137: #ifndef _VA_LIST
138: #define _VA_LIST va_list
139: #endif
140: #endif /* __i860__ */
1.1.1.3 root 141: typedef __gnuc_va_list va_list;
142: #endif /* _VA_LIST_ */
143:
1.1.1.4 root 144: #else /* not __svr4__ */
1.1.1.3 root 145:
146: /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
147: But on BSD NET2 we must not test or define or undef it.
148: (Note that the comments in NET 2's ansi.h
149: are incorrect for _VA_LIST_--see stdio.h!) */
1.1.1.5 ! root 150: /* Michael Eriksson <[email protected]> at Thu Sep 30 11:00:57 1993:
! 151: Sequent defines _VA_LIST_ in <machine/machtypes.h> to be the type to
! 152: use for va_list (``typedef _VA_LIST_ va_list'') */
! 153: #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__)
1.1.1.3 root 154: /* The macro _VA_LIST is used in SCO Unix 3.2. */
155: #ifndef _VA_LIST
1.1.1.4 root 156: /* The macro _VA_LIST_T_H is used in the Bull dpx2 */
157: #ifndef _VA_LIST_T_H
158: #define _VA_LIST_T_H
1.1.1.5 ! root 159: #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__))
1.1.1.3 root 160: #define _VA_LIST_
161: #endif
162: #define _VA_LIST
163: typedef __gnuc_va_list va_list;
1.1.1.4 root 164: #endif /* not _VA_LIST_T_H */
1.1.1.3 root 165: #endif /* not _VA_LIST */
1.1.1.5 ! root 166: #endif /* not _VA_LIST_, except on certain systems */
1.1.1.3 root 167:
1.1.1.4 root 168: #endif /* not __svr4__ */
1.1.1.3 root 169:
170: /* The next BSD release (if there is one) wants this symbol to be
171: undefined instead of _VA_LIST_. */
172: #ifdef _BSD_VA_LIST
173: #undef _BSD_VA_LIST
174: #endif
175:
1.1 root 176: #endif /* __GNUC__ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.