Rev 359 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
704 | serge | 1 | /**************************************************************************** |
2 | * |
||
3 | * Open Watcom Project |
||
4 | * |
||
5 | * Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. |
||
6 | * |
||
7 | * ======================================================================== |
||
8 | * |
||
9 | * This file contains Original Code and/or Modifications of Original |
||
10 | * Code as defined in and that are subject to the Sybase Open Watcom |
||
11 | * Public License version 1.0 (the 'License'). You may not use this file |
||
12 | * except in compliance with the License. BY USING THIS FILE YOU AGREE TO |
||
13 | * ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is |
||
14 | * provided with the Original Code and Modifications, and is also |
||
15 | * available at www.sybase.com/developer/opensource. |
||
16 | * |
||
17 | * The Original Code and all software distributed under the License are |
||
18 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER |
||
19 | * EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM |
||
20 | * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF |
||
21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR |
||
22 | * NON-INFRINGEMENT. Please see the License for the specific language |
||
23 | * governing rights and limitations under the License. |
||
24 | * |
||
25 | * ======================================================================== |
||
26 | * |
||
27 | * Description: Configuration for clib builds. |
||
28 | * |
||
29 | ****************************************************************************/ |
||
30 | |||
31 | |||
32 | #ifndef _VARIETY_H_INCLUDED |
||
33 | #define _VARIETY_H_INCLUDED |
||
34 | |||
35 | // |
||
36 | // Note: for the DLL versions of the runtime libraries, this file must be |
||
37 | // included before any of the runtime header files. |
||
38 | // |
||
39 | |||
40 | #ifndef _COMDEF_H_INCLUDED |
||
41 | #include <_comdef.h> |
||
42 | #endif |
||
43 | |||
44 | // specialized data reference macro |
||
45 | #define _HUGEDATA _WCDATA |
||
46 | |||
47 | // memory model macros |
||
48 | #if defined(__SMALL__) |
||
49 | #define __SMALL_DATA__ |
||
50 | #define __SMALL_CODE__ |
||
51 | #elif defined(__FLAT__) |
||
52 | #define __SMALL_DATA__ |
||
53 | #define __SMALL_CODE__ |
||
54 | #elif defined(__MEDIUM__) |
||
55 | #define __SMALL_DATA__ |
||
56 | #define __BIG_CODE__ |
||
57 | #elif defined(__COMPACT__) |
||
58 | #define __BIG_DATA__ |
||
59 | #define __SMALL_CODE__ |
||
60 | #elif defined(__LARGE__) |
||
61 | #define __BIG_DATA__ |
||
62 | #define __BIG_CODE__ |
||
63 | #elif defined(__HUGE__) |
||
64 | #define __BIG_DATA__ |
||
65 | #define __BIG_CODE__ |
||
66 | #elif defined(__AXP__) || defined(__PPC__) || defined(__MIPS__) |
||
67 | // these effectively use near data references |
||
68 | #define __SMALL_DATA__ |
||
69 | #define __SMALL_CODE__ |
||
70 | #else |
||
71 | #error unable to configure memory model |
||
72 | #endif |
||
73 | |||
74 | // operating system and processor macros |
||
75 | #if defined(__GENERIC__) |
||
76 | #if defined(__386__) |
||
77 | #define __PROTECT_MODE__ |
||
78 | #define __GENERIC_386__ |
||
79 | #elif defined(M_I86) |
||
80 | #define __REAL_MODE__ |
||
81 | #define __GENERIC_086__ |
||
82 | #else |
||
83 | #error unrecognized processor for GENERIC |
||
84 | #endif |
||
85 | #elif defined(__OS2__) |
||
86 | #if defined(M_I86) |
||
87 | #define __REAL_MODE__ |
||
88 | #define __OS2_286__ |
||
89 | #elif defined(__386__) |
||
90 | #define __PROTECT_MODE__ |
||
91 | #define __OS2_386__ |
||
92 | #define __WARP__ |
||
93 | #elif defined(__PPC__) |
||
94 | #define __PROTECT_MODE__ |
||
95 | #define __OS2_PPC__ |
||
96 | #define __WARP__ |
||
97 | #else |
||
98 | #error unrecognized processor for OS2 |
||
99 | #endif |
||
100 | #elif defined(__NT__) |
||
101 | #if !defined(WIN32_LEAN_AND_MEAN) && !defined(WIN32_NICE_AND_FAT) |
||
102 | #define WIN32_LEAN_AND_MEAN |
||
103 | #endif |
||
104 | #define __PROTECT_MODE__ |
||
105 | #if defined(__386__) |
||
106 | #define __NT_386__ |
||
107 | #elif defined(__AXP__) |
||
108 | #define __NT_AXP__ |
||
109 | #elif defined(__PPC__) |
||
110 | #define __NT_PPC__ |
||
111 | #else |
||
112 | #error unrecognized processor for NT |
||
113 | #endif |
||
114 | #elif defined(__WINDOWS__) || defined(__WINDOWS_386__) |
||
115 | #define __PROTECT_MODE__ |
||
116 | #if defined(__386__) |
||
117 | #define __WINDOWS__ |
||
118 | #elif defined(M_I86) |
||
119 | #define __WINDOWS_286__ |
||
120 | #else |
||
121 | #error unrecognized processor for WINDOWS |
||
122 | #endif |
||
123 | #elif defined(__DOS__) |
||
124 | #if defined(__386__) |
||
125 | #define __PROTECT_MODE__ |
||
126 | #define __DOS_386__ |
||
127 | #elif defined(M_I86) |
||
128 | #define __REAL_MODE__ |
||
129 | #define __DOS_086__ |
||
130 | #else |
||
131 | #error unrecognized processor for DOS |
||
132 | #endif |
||
133 | #elif defined(__OSI__) |
||
134 | #if defined(__386__) |
||
135 | #define __PROTECT_MODE__ |
||
136 | #define __OSI_386__ |
||
137 | #else |
||
138 | #error unrecognized processor for OSI |
||
139 | #endif |
||
140 | #elif defined(__QNX__) |
||
141 | #define __PROTECT_MODE__ |
||
142 | #define __UNIX__ |
||
143 | #if defined(__386__) |
||
144 | #define __QNX_386__ |
||
145 | #elif defined(M_I86) |
||
146 | #define __QNX_286__ |
||
147 | #else |
||
148 | #error unrecognized processor for QNX |
||
149 | #endif |
||
150 | #elif defined(__LINUX__) |
||
151 | #define __PROTECT_MODE__ |
||
152 | #define __UNIX__ |
||
153 | #if defined(__386__) |
||
154 | #define __LINUX_386__ |
||
155 | #elif defined(__PPC__) |
||
156 | #define __LINUX_PPC__ |
||
157 | #elif defined(__MIPS__) |
||
158 | #define __LINUX_MIPS__ |
||
159 | #else |
||
160 | #error unrecognized processor for Linux |
||
161 | #endif |
||
162 | #elif defined(__NETWARE__) |
||
163 | #define __PROTECT_MODE__ |
||
164 | #if defined(__386__) |
||
165 | #define __NETWARE_386__ |
||
166 | #else |
||
167 | #error unrecognized processor for NETWARE |
||
168 | #endif |
||
169 | #else |
||
170 | #error unable to configure operating system and processor |
||
171 | #endif |
||
172 | |||
173 | // handle building dll's with appropriate linkage |
||
174 | #if !defined(__SW_BR) && (defined(__WARP__) || defined(__NT__)) |
||
175 | #if defined(__MAKE_DLL_CLIB) |
||
176 | #undef _WCRTLINK |
||
177 | #undef _WCIRTLINK |
||
178 | #undef _WCRTLINKD |
||
179 | #undef _WMRTLINK |
||
180 | #undef _WMIRTLINK |
||
181 | #undef _WMRTLINKD |
||
182 | #undef _WPRTLINK |
||
183 | #undef _WPIRTLINK |
||
184 | #undef _WPRTLINKD |
||
185 | #if defined(__NT__) |
||
186 | #define _WCRTLINK __declspec(dllexport) _WRTLCALL |
||
187 | #define _WCIRTLINK __declspec(dllexport) _WRTLCALL |
||
188 | #define _WCRTLINKD __declspec(dllexport) |
||
189 | #define _WMRTLINK __declspec(dllimport) _WRTLCALL |
||
190 | #define _WMIRTLINK __declspec(dllimport) _WRTLCALL |
||
191 | #define _WMRTLINKD __declspec(dllimport) |
||
192 | #define _WPRTLINK __declspec(dllimport) _WRTLCALL |
||
193 | #define _WPIRTLINK __declspec(dllimport) _WRTLCALL |
||
194 | #define _WPRTLINKD __declspec(dllimport) |
||
195 | #elif defined(__WARP__) |
||
196 | #define _WCRTLINK __declspec(dllexport) _WRTLCALL |
||
197 | #define _WCIRTLINK __declspec(dllexport) _WRTLCALL |
||
198 | #define _WCRTLINKD __declspec(dllexport) |
||
199 | #define _WMRTLINK _WRTLCALL |
||
200 | #define _WMIRTLINK _WRTLCALL |
||
201 | #define _WMRTLINKD |
||
202 | #define _WPRTLINK _WRTLCALL |
||
203 | #define _WPIRTLINK _WRTLCALL |
||
204 | #define _WPRTLINKD |
||
205 | #endif |
||
206 | #elif defined(__MAKE_DLL_MATHLIB) |
||
207 | #define _RTDLL |
||
208 | #undef _WCRTLINK |
||
209 | #undef _WCIRTLINK |
||
210 | #undef _WCRTLINKD |
||
211 | #undef _WMRTLINK |
||
212 | #undef _WMIRTLINK |
||
213 | #undef _WMRTLINKD |
||
214 | #undef _WPRTLINK |
||
215 | #undef _WPIRTLINK |
||
216 | #undef _WPRTLINKD |
||
217 | #if defined(__NT__) |
||
218 | #define _WCRTLINK __declspec(dllimport) _WRTLCALL |
||
219 | #define _WCIRTLINK __declspec(dllimport) _WRTLCALL |
||
220 | #define _WCRTLINKD __declspec(dllimport) |
||
221 | #define _WMRTLINK __declspec(dllexport) _WRTLCALL |
||
222 | #define _WMIRTLINK __declspec(dllexport) _WRTLCALL |
||
223 | #define _WMRTLINKD __declspec(dllexport) |
||
224 | #define _WPRTLINK __declspec(dllimport) _WRTLCALL |
||
225 | #define _WPIRTLINK __declspec(dllimport) _WRTLCALL |
||
226 | #define _WPRTLINKD __declspec(dllimport) |
||
227 | #elif defined(__WARP__) |
||
228 | #define _WCRTLINK _WRTLCALL |
||
229 | #define _WCIRTLINK _WRTLCALL |
||
230 | #define _WCRTLINKD |
||
231 | #define _WMRTLINK __declspec(dllexport) _WRTLCALL |
||
232 | #define _WMIRTLINK __declspec(dllexport) _WRTLCALL |
||
233 | #define _WMRTLINKD __declspec(dllexport) |
||
234 | #define _WPRTLINK _WRTLCALL |
||
235 | #define _WPIRTLINK _WRTLCALL |
||
236 | #define _WPRTLINKD |
||
237 | #endif |
||
238 | #elif defined(__MAKE_DLL_CPPLIB) |
||
239 | #define _RTDLL |
||
240 | #undef _WCRTLINK |
||
241 | #undef _WCIRTLINK |
||
242 | #undef _WCRTLINKD |
||
243 | #undef _WMRTLINK |
||
244 | #undef _WMIRTLINK |
||
245 | #undef _WMRTLINKD |
||
246 | #undef _WPRTLINK |
||
247 | #undef _WPIRTLINK |
||
248 | #undef _WPRTLINKD |
||
249 | #if defined(__NT__) |
||
250 | #define _WCRTLINK __declspec(dllimport) _WRTLCALL |
||
251 | #define _WCIRTLINK __declspec(dllimport) _WRTLCALL |
||
252 | #define _WCRTLINKD __declspec(dllimport) |
||
253 | #define _WMRTLINK __declspec(dllimport) _WRTLCALL |
||
254 | #define _WMIRTLINK __declspec(dllimport) _WRTLCALL |
||
255 | #define _WMRTLINKD __declspec(dllimport) |
||
256 | #define _WPRTLINK __declspec(dllexport) _WRTLCALL |
||
257 | #define _WPIRTLINK __declspec(dllexport) _WRTLCALL |
||
258 | #define _WPRTLINKD __declspec(dllexport) |
||
259 | #elif defined(__WARP__) |
||
260 | #define _WCRTLINK _WRTLCALL |
||
261 | #define _WCIRTLINK _WRTLCALL |
||
262 | #define _WCRTLINKD |
||
263 | #define _WMRTLINK _WRTLCALL |
||
264 | #define _WMIRTLINK _WRTLCALL |
||
265 | #define _WMRTLINKD |
||
266 | #define _WPRTLINK __declspec(dllexport) _WRTLCALL |
||
267 | #define _WPIRTLINK __declspec(dllexport) _WRTLCALL |
||
268 | #define _WPRTLINKD __declspec(dllexport) |
||
269 | #endif |
||
270 | #endif |
||
271 | #endif |
||
272 | |||
273 | #define __ptr_check( p, a ) |
||
274 | #define __null_check( p, a ) |
||
275 | #define __stream_check( s, a ) |
||
276 | |||
277 | #define __ROUND_UP_SIZE( __x, __amt ) (((__x)+((__amt)-1))&(~((__amt)-1))) |
||
278 | /// |
||
279 | /// This doesn't work for far pointer's |
||
280 | /// |
||
281 | ///#define __ROUND_UP_PTR( __x, __amt ) ((void *)__ROUND_UP_SIZE((unsigned)(__x),__amt)) |
||
282 | #if defined(M_I86) |
||
283 | #define __ALIGN_SIZE( __x ) __ROUND_UP_SIZE( __x, 2 ) |
||
284 | // #define __ALIGN_PTR( __x ) __ROUND_UP_PTR( __x, 2 ) |
||
285 | #elif defined(__386__) |
||
286 | #define __ALIGN_SIZE( __x ) __ROUND_UP_SIZE( __x, 4 ) |
||
287 | /// #define __ALIGN_PTR( __x ) __ROUND_UP_PTR( __x, 4 ) |
||
288 | #else |
||
289 | #define __ALIGN_SIZE( __x ) __ROUND_UP_SIZE( __x, 8 ) |
||
290 | // #define __ALIGN_PTR( __x ) __ROUND_UP_PTR( __x, 8 ) |
||
291 | #endif |
||
292 | |||
293 | #endif |
||
294 | |||
295 | #undef _WCRTLINKD |
||
296 | #define _WCRTLINKD |