|
|
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 root 40:
41: #ifdef __NeXT__
42:
43: /* On Next, erase any vestiges of stdarg.h. */
44:
1.1.1.3 root 45: #ifdef _ANSI_STDARG_H_
46: #define _VA_LIST_
47: #endif
48: #define _ANSI_STDARG_H_
49:
1.1 root 50: #undef va_alist
51: #undef va_dcl
52: #undef va_list
53: #undef va_start
54: #undef va_end
55: #undef __va_rounded_size
56: #undef va_arg
57: #endif /* __NeXT__ */
58:
59: /* In GCC version 2, we want an ellipsis at the end of the declaration
60: of the argument list. GCC version 1 can't parse it. */
61:
62: #if __GNUC__ > 1
63: #define __va_ellipsis ...
64: #else
65: #define __va_ellipsis
66: #endif
67:
68: /* These macros implement traditional (non-ANSI) varargs
69: for GNU C. */
70:
71: #define va_alist __builtin_va_alist
72: /* The ... causes current_function_varargs to be set in cc1. */
73: #define va_dcl int __builtin_va_alist; __va_ellipsis
74:
1.1.1.3 root 75: /* Define __gnuc_va_list, just as in gstdarg.h. */
1.1 root 76:
1.1.1.3 root 77: #ifndef __GNUC_VA_LIST
78: #define __GNUC_VA_LIST
79: #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
80: typedef char *__gnuc_va_list;
81: #else
82: typedef void *__gnuc_va_list;
1.1 root 83: #endif
84: #endif
85:
86: #define va_start(AP) AP=(char *) &__builtin_va_alist
87:
88: #define va_end(AP)
89:
90: #define __va_rounded_size(TYPE) \
91: (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
92:
1.1.1.3 root 93: #if defined (__arm__) || defined (__i386__) || defined (__ns32000__) || defined (__vax__)
94: /* This is for little-endian machines; small args are padded upward. */
95: #define va_arg(AP, TYPE) \
96: (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
97: *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))
98: #else /* big-endian */
99: /* This is for big-endian machines; small args are padded downward. */
1.1 root 100: #define va_arg(AP, TYPE) \
1.1.1.3 root 101: (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
102: *((TYPE *) (void *) ((char *) (AP) - ((sizeof (TYPE) < 4 \
103: ? sizeof (TYPE) \
104: : __va_rounded_size (TYPE))))))
105: #endif /* big-endian */
1.1 root 106:
1.1.1.3 root 107: #endif /* not alpha */
1.1.1.2 root 108: #endif /* not i960 */
1.1.1.3 root 109: #endif /* not hppa */
1.1 root 110: #endif /* not m88k */
1.1.1.4 ! root 111: #endif /* not clipper */
1.1 root 112: #endif /* not pyr */
113: #endif /* not i860 */
114: #endif /* not mips */
115: #endif /* not spur */
116: #endif /* not sparc */
117: #endif /* not _VARARGS_H */
1.1.1.3 root 118:
119: /* Define va_list from __gnuc_va_list. */
120:
121: #ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
122: #undef _VA_LIST
123: #endif
124:
1.1.1.4 ! root 125: #ifdef __svr4__
1.1.1.3 root 126: /* SVR4.2 uses _VA_LIST for an internal alias for va_list,
1.1.1.4 ! root 127: so we must avoid testing it and setting it here.
! 128: SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
! 129: have no conflict with that. */
1.1.1.3 root 130: #ifndef _VA_LIST_
131: #define _VA_LIST_
1.1.1.4 ! root 132: #ifdef __i860__
! 133: #ifndef _VA_LIST
! 134: #define _VA_LIST va_list
! 135: #endif
! 136: #endif /* __i860__ */
1.1.1.3 root 137: typedef __gnuc_va_list va_list;
138: #endif /* _VA_LIST_ */
139:
1.1.1.4 ! root 140: #else /* not __svr4__ */
1.1.1.3 root 141:
142: /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
143: But on BSD NET2 we must not test or define or undef it.
144: (Note that the comments in NET 2's ansi.h
145: are incorrect for _VA_LIST_--see stdio.h!) */
146: #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____)
147: /* The macro _VA_LIST is used in SCO Unix 3.2. */
148: #ifndef _VA_LIST
1.1.1.4 ! root 149: /* The macro _VA_LIST_T_H is used in the Bull dpx2 */
! 150: #ifndef _VA_LIST_T_H
! 151: #define _VA_LIST_T_H
1.1.1.3 root 152: #if !(defined (__BSD_NET2__) || defined (____386BSD____))
153: #define _VA_LIST_
154: #endif
155: #define _VA_LIST
156: typedef __gnuc_va_list va_list;
1.1.1.4 ! root 157: #endif /* not _VA_LIST_T_H */
1.1.1.3 root 158: #endif /* not _VA_LIST */
159: #endif /* not _VA_LIST_ */
160:
1.1.1.4 ! root 161: #endif /* not __svr4__ */
1.1.1.3 root 162:
163: /* The next BSD release (if there is one) wants this symbol to be
164: undefined instead of _VA_LIST_. */
165: #ifdef _BSD_VA_LIST
166: #undef _BSD_VA_LIST
167: #endif
168:
1.1 root 169: #endif /* __GNUC__ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.