implement _byteswap_ushort for arm
[reactos.git] / reactos / include / crt / stdarg.h
1 /* Copyright (C) 1989, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
2
3 This file is part of GCC.
4
5 GCC is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
9
10 GCC is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GCC; see the file COPYING. If not, write to
17 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA. */
19
20 /* As a special exception, if you include this header file into source
21 files compiled by GCC, this header file does not by itself cause
22 the resulting executable to be covered by the GNU General Public
23 License. This exception does not however invalidate any other
24 reasons why the executable file might be covered by the GNU General
25 Public License. */
26
27 /*
28 * ISO C Standard: 7.15 Variable arguments <stdarg.h>
29 */
30
31 #ifndef _INC_STDARG
32 #define _INC_STDARG
33 #ifndef _WIN32
34 #error Only Win32 target is supported!
35 #endif
36
37 #ifndef _STDARG_H
38 #ifndef _ANSI_STDARG_H_
39 #ifndef __need___va_list
40 #define _STDARG_H
41 #define _ANSI_STDARG_H_
42 #endif /* not __need___va_list */
43 #undef __need___va_list
44
45 /* Define __gnuc_va_list. */
46
47 #ifdef __GNUC__
48 #ifndef __GNUC_VA_LIST
49 #define __GNUC_VA_LIST
50 typedef __builtin_va_list __gnuc_va_list;
51 #endif
52 #endif
53
54 /* Define the standard macros for the user,
55 if this invocation was from the user program. */
56 #ifdef _STDARG_H
57
58 #ifdef __GNUC__
59 #define va_start(v,l) __builtin_va_start(v,l)
60 #define va_end(v) __builtin_va_end(v)
61 #define va_arg(v,l) __builtin_va_arg(v,l)
62 #if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L
63 #define va_copy(d,s) __builtin_va_copy(d,s)
64 #endif
65 #define __va_copy(d,s) __builtin_va_copy(d,s)
66 #endif
67
68 /* Define va_list, if desired, from __gnuc_va_list. */
69 /* We deliberately do not define va_list when called from
70 stdio.h, because ANSI C says that stdio.h is not supposed to define
71 va_list. stdio.h needs to have access to that data type,
72 but must not use that name. It should use the name __gnuc_va_list,
73 which is safe because it is reserved for the implementation. */
74
75 #ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
76 #undef _VA_LIST
77 #endif
78
79 #ifdef _BSD_VA_LIST
80 #undef _BSD_VA_LIST
81 #endif
82
83 #ifdef __GNUC__
84 #if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
85 /* SVR4.2 uses _VA_LIST for an internal alias for va_list,
86 so we must avoid testing it and setting it here.
87 SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
88 have no conflict with that. */
89 #ifndef _VA_LIST_
90 #define _VA_LIST_
91 #ifdef __i860__
92 #ifndef _VA_LIST
93 #define _VA_LIST va_list
94 #endif
95 #endif /* __i860__ */
96 typedef __gnuc_va_list va_list;
97 #ifdef _SCO_DS
98 #define __VA_LIST
99 #endif
100 #endif /* _VA_LIST_ */
101 #else /* not __svr4__ || _SCO_DS */
102
103 /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
104 But on BSD NET2 we must not test or define or undef it.
105 (Note that the comments in NET 2's ansi.h
106 are incorrect for _VA_LIST_--see stdio.h!) */
107 #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
108 /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */
109 #ifndef _VA_LIST_DEFINED
110 /* The macro _VA_LIST is used in SCO Unix 3.2. */
111 #ifndef _VA_LIST
112 /* The macro _VA_LIST_T_H is used in the Bull dpx2 */
113 #ifndef _VA_LIST_T_H
114 /* The macro __va_list__ is used by BeOS. */
115 #ifndef __va_list__
116 typedef __gnuc_va_list va_list;
117 #endif /* not __va_list__ */
118 #endif /* not _VA_LIST_T_H */
119 #endif /* not _VA_LIST */
120 #endif /* not _VA_LIST_DEFINED */
121 #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
122 #define _VA_LIST_
123 #endif
124 #ifndef _VA_LIST
125 #define _VA_LIST
126 #endif
127 #ifndef _VA_LIST_DEFINED
128 #define _VA_LIST_DEFINED
129 #endif
130 #ifndef _VA_LIST_T_H
131 #define _VA_LIST_T_H
132 #endif
133 #ifndef __va_list__
134 #define __va_list__
135 #endif
136
137 #endif /* not _VA_LIST_, except on certain systems */
138
139 #endif /* not __svr4__ */
140
141 #endif /* __GNUC__ */
142 #endif /* _STDARG_H */
143
144 #endif /* not _ANSI_STDARG_H_ */
145 #endif /* not _STDARG_H */
146
147 #include <vadefs.h>
148
149 #ifndef va_start
150 #define va_start _crt_va_start
151 #endif
152 #ifndef va_arg
153 #define va_arg _crt_va_arg
154 #endif
155 #ifndef va_end
156 #define va_end _crt_va_end
157 #endif
158
159 #endif