]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | /* |
2 | ****************************************************************************** | |
3 | * | |
73c04bcf | 4 | * Copyright (C) 1997-2006, International Business Machines |
b75a7d8f A |
5 | * Corporation and others. All Rights Reserved. |
6 | * | |
7 | ****************************************************************************** | |
8 | * | |
9 | * FILE NAME : platform.h | |
10 | * | |
11 | * Date Name Description | |
12 | * 05/13/98 nos Creation (content moved here from ptypes.h). | |
13 | * 03/02/99 stephen Added AS400 support. | |
14 | * 03/30/99 stephen Added Linux support. | |
15 | * 04/13/99 stephen Reworked for autoconf. | |
16 | ****************************************************************************** | |
17 | */ | |
18 | ||
73c04bcf A |
19 | /** |
20 | * \file | |
21 | * \brief Configuration constants for the Windows platform | |
22 | */ | |
23 | ||
b75a7d8f | 24 | /* Define the platform we're on. */ |
73c04bcf A |
25 | #ifndef U_WINDOWS |
26 | #define U_WINDOWS | |
b75a7d8f A |
27 | #endif |
28 | ||
374ca955 A |
29 | #if defined(__BORLANDC__) |
30 | #define U_HAVE_PLACEMENT_NEW 0 | |
31 | #define U_HAVE_INTTYPES_H 1 | |
32 | #define __STDC_CONSTANT_MACROS | |
33 | #endif | |
34 | ||
73c04bcf A |
35 | /* _MSC_VER is used to detect the Microsoft compiler. */ |
36 | #if defined(_MSC_VER) | |
37 | #define U_INT64_IS_LONG_LONG 0 | |
38 | #else | |
39 | #define U_INT64_IS_LONG_LONG 1 | |
40 | #endif | |
41 | ||
b75a7d8f | 42 | /* Define whether inttypes.h is available */ |
374ca955 | 43 | #ifndef U_HAVE_INTTYPES_H |
b75a7d8f | 44 | #define U_HAVE_INTTYPES_H 0 |
374ca955 | 45 | #endif |
b75a7d8f A |
46 | |
47 | /* | |
48 | * Define what support for C++ streams is available. | |
49 | * If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available | |
50 | * (1997711 is the date the ISO/IEC C++ FDIS was published), and then | |
51 | * one should qualify streams using the std namespace in ICU header | |
52 | * files. | |
53 | * If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is | |
54 | * available instead (198506 is the date when Stroustrup published | |
55 | * "An Extensible I/O Facility for C++" at the summer USENIX conference). | |
56 | * If U_IOSTREAM_SOURCE is 0, then C++ streams are not available and | |
57 | * support for them will be silently suppressed in ICU. | |
58 | * | |
59 | */ | |
60 | ||
61 | #ifndef U_IOSTREAM_SOURCE | |
62 | #define U_IOSTREAM_SOURCE 199711 | |
63 | #endif | |
64 | ||
65 | /* Determines whether specific types are available */ | |
374ca955 A |
66 | #ifndef U_HAVE_INT8_T |
67 | #define U_HAVE_INT8_T U_HAVE_INTTYPES_H | |
68 | #endif | |
b75a7d8f | 69 | |
374ca955 A |
70 | #ifndef U_HAVE_UINT8_T |
71 | #define U_HAVE_UINT8_T U_HAVE_INTTYPES_H | |
72 | #endif | |
b75a7d8f | 73 | |
374ca955 A |
74 | #ifndef U_HAVE_INT16_T |
75 | #define U_HAVE_INT16_T U_HAVE_INTTYPES_H | |
76 | #endif | |
b75a7d8f | 77 | |
374ca955 A |
78 | #ifndef U_HAVE_UINT16_T |
79 | #define U_HAVE_UINT16_T U_HAVE_INTTYPES_H | |
b75a7d8f | 80 | #endif |
374ca955 A |
81 | |
82 | #ifndef U_HAVE_INT32_T | |
83 | #define U_HAVE_INT32_T U_HAVE_INTTYPES_H | |
b75a7d8f A |
84 | #endif |
85 | ||
374ca955 A |
86 | #ifndef U_HAVE_UINT32_T |
87 | #define U_HAVE_UINT32_T U_HAVE_INTTYPES_H | |
88 | #endif | |
89 | ||
90 | #ifndef U_HAVE_INT64_T | |
91 | #define U_HAVE_INT64_T U_HAVE_INTTYPES_H | |
92 | #endif | |
93 | ||
94 | #ifndef U_HAVE_UINT64_T | |
95 | #define U_HAVE_UINT64_T U_HAVE_INTTYPES_H | |
96 | #endif | |
97 | ||
98 | /* Define 64 bit limits */ | |
73c04bcf A |
99 | #if !U_INT64_IS_LONG_LONG |
100 | # ifndef INT64_C | |
101 | # define INT64_C(x) ((int64_t)x) | |
102 | # endif | |
103 | # ifndef UINT64_C | |
104 | # define UINT64_C(x) ((uint64_t)x) | |
105 | # endif | |
106 | /* else use the umachine.h definition */ | |
107 | #endif | |
374ca955 | 108 | |
b75a7d8f A |
109 | /*===========================================================================*/ |
110 | /* Generic data types */ | |
111 | /*===========================================================================*/ | |
112 | ||
113 | /* If your platform does not have the <inttypes.h> header, you may | |
114 | need to edit the typedefs below. */ | |
115 | #if U_HAVE_INTTYPES_H | |
116 | #include <inttypes.h> | |
374ca955 | 117 | #else /* U_HAVE_INTTYPES_H */ |
b75a7d8f A |
118 | |
119 | #if ! U_HAVE_INT8_T | |
120 | typedef signed char int8_t; | |
121 | #endif | |
122 | ||
123 | #if ! U_HAVE_UINT8_T | |
124 | typedef unsigned char uint8_t; | |
125 | #endif | |
126 | ||
127 | #if ! U_HAVE_INT16_T | |
128 | typedef signed short int16_t; | |
129 | #endif | |
130 | ||
131 | #if ! U_HAVE_UINT16_T | |
132 | typedef unsigned short uint16_t; | |
133 | #endif | |
134 | ||
135 | #if ! U_HAVE_INT32_T | |
374ca955 | 136 | typedef signed int int32_t; |
b75a7d8f A |
137 | #endif |
138 | ||
139 | #if ! U_HAVE_UINT32_T | |
374ca955 | 140 | typedef unsigned int uint32_t; |
b75a7d8f A |
141 | #endif |
142 | ||
143 | #if ! U_HAVE_INT64_T | |
73c04bcf | 144 | #if U_INT64_IS_LONG_LONG |
374ca955 | 145 | typedef signed long long int64_t; |
73c04bcf A |
146 | #else |
147 | typedef signed __int64 int64_t; | |
374ca955 | 148 | #endif |
b75a7d8f A |
149 | #endif |
150 | ||
151 | #if ! U_HAVE_UINT64_T | |
73c04bcf | 152 | #if U_INT64_IS_LONG_LONG |
374ca955 | 153 | typedef unsigned long long uint64_t; |
73c04bcf A |
154 | #else |
155 | typedef unsigned __int64 uint64_t; | |
374ca955 | 156 | #endif |
b75a7d8f | 157 | #endif |
b75a7d8f A |
158 | #endif |
159 | ||
160 | /*===========================================================================*/ | |
374ca955 | 161 | /* Compiler and environment features */ |
b75a7d8f A |
162 | /*===========================================================================*/ |
163 | ||
374ca955 A |
164 | /* Define whether namespace is supported */ |
165 | #ifndef U_HAVE_NAMESPACE | |
166 | #define U_HAVE_NAMESPACE 1 | |
167 | #endif | |
168 | ||
169 | /* Determines the endianness of the platform */ | |
170 | #define U_IS_BIG_ENDIAN 0 | |
171 | ||
172 | /* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */ | |
173 | #define ICU_USE_THREADS 1 | |
174 | ||
73c04bcf A |
175 | /* On strong memory model CPUs (e.g. x86 CPUs), we use a safe & quick double check mutex lock. */ |
176 | /* | |
177 | Microsoft can define _M_IX86, _M_AMD64 (before Visual Studio 8) or _M_X64 (starting in Visual Studio 8). | |
178 | Intel can define _M_IX86 or _M_X64 | |
179 | */ | |
180 | #if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) | |
374ca955 | 181 | #define UMTX_STRONG_MEMORY_MODEL 1 |
73c04bcf | 182 | #endif |
374ca955 A |
183 | |
184 | #ifndef U_DEBUG | |
185 | #ifdef _DEBUG | |
186 | #define U_DEBUG 1 | |
187 | #else | |
188 | #define U_DEBUG 0 | |
189 | #endif | |
190 | #endif | |
191 | ||
192 | #ifndef U_RELEASE | |
193 | #ifdef NDEBUG | |
194 | #define U_RELEASE 1 | |
195 | #else | |
196 | #define U_RELEASE 0 | |
197 | #endif | |
198 | #endif | |
73c04bcf | 199 | |
374ca955 A |
200 | /* Determine whether to disable renaming or not. This overrides the |
201 | setting in umachine.h which is for all platforms. */ | |
202 | #ifndef U_DISABLE_RENAMING | |
203 | #define U_DISABLE_RENAMING 0 | |
204 | #endif | |
205 | ||
206 | /* Determine whether to override new and delete. */ | |
207 | #ifndef U_OVERRIDE_CXX_ALLOCATION | |
208 | #define U_OVERRIDE_CXX_ALLOCATION 1 | |
209 | #endif | |
210 | /* Determine whether to override placement new and delete for STL. */ | |
211 | #ifndef U_HAVE_PLACEMENT_NEW | |
212 | #define U_HAVE_PLACEMENT_NEW 1 | |
213 | #endif | |
73c04bcf A |
214 | /* Determine whether to override new and delete for MFC. */ |
215 | #if !defined(U_HAVE_DEBUG_LOCATION_NEW) && defined(_MSC_VER) | |
216 | #define U_HAVE_DEBUG_LOCATION_NEW 1 | |
217 | #endif | |
374ca955 A |
218 | |
219 | /* Determine whether to enable tracing. */ | |
220 | #ifndef U_ENABLE_TRACING | |
221 | #define U_ENABLE_TRACING 1 | |
222 | #endif | |
223 | ||
73c04bcf A |
224 | /* Do we allow ICU users to use the draft APIs by default? */ |
225 | #ifndef U_DEFAULT_SHOW_DRAFT | |
226 | #define U_DEFAULT_SHOW_DRAFT 1 | |
227 | #endif | |
228 | ||
374ca955 A |
229 | /* Define the library suffix in a C syntax. */ |
230 | #define U_HAVE_LIB_SUFFIX 0 | |
231 | #define U_LIB_SUFFIX_C_NAME | |
232 | #define U_LIB_SUFFIX_C_NAME_STRING "" | |
b75a7d8f A |
233 | |
234 | /*===========================================================================*/ | |
374ca955 | 235 | /* Information about wchar support */ |
b75a7d8f A |
236 | /*===========================================================================*/ |
237 | ||
374ca955 A |
238 | #define U_HAVE_WCHAR_H 1 |
239 | #define U_SIZEOF_WCHAR_T 2 | |
240 | ||
241 | #define U_HAVE_WCSCPY 1 | |
b75a7d8f A |
242 | |
243 | /*===========================================================================*/ | |
244 | /* Information about POSIX support */ | |
245 | /*===========================================================================*/ | |
246 | ||
73c04bcf | 247 | #if 1 |
b75a7d8f | 248 | #define U_TZSET _tzset |
b75a7d8f | 249 | #endif |
73c04bcf A |
250 | #if 1 |
251 | #define U_TIMEZONE _timezone | |
252 | #endif | |
253 | #if 1 | |
b75a7d8f | 254 | #define U_TZNAME _tzname |
73c04bcf | 255 | #endif |
b75a7d8f | 256 | |
374ca955 A |
257 | #define U_HAVE_MMAP 0 |
258 | #define U_HAVE_POPEN 0 | |
b75a7d8f A |
259 | |
260 | /*===========================================================================*/ | |
261 | /* Symbol import-export control */ | |
262 | /*===========================================================================*/ | |
263 | ||
374ca955 A |
264 | #ifdef U_STATIC_IMPLEMENTATION |
265 | #define U_EXPORT | |
266 | #else | |
b75a7d8f | 267 | #define U_EXPORT __declspec(dllexport) |
374ca955 | 268 | #endif |
b75a7d8f A |
269 | #define U_EXPORT2 __cdecl |
270 | #define U_IMPORT __declspec(dllimport) | |
271 | ||
272 | /*===========================================================================*/ | |
273 | /* Code alignment and C function inlining */ | |
274 | /*===========================================================================*/ | |
275 | ||
374ca955 | 276 | #ifndef U_INLINE |
73c04bcf A |
277 | # ifdef __cplusplus |
278 | # define U_INLINE inline | |
279 | # else | |
280 | # define U_INLINE __inline | |
281 | # endif | |
374ca955 | 282 | #endif |
b75a7d8f | 283 | |
73c04bcf | 284 | #if defined(_MSC_VER) && defined(_M_IX86) && !defined(_MANAGED) |
b75a7d8f A |
285 | #define U_ALIGN_CODE(val) __asm align val |
286 | #else | |
287 | #define U_ALIGN_CODE(val) | |
288 | #endif | |
73c04bcf | 289 | |
b75a7d8f A |
290 | |
291 | /*===========================================================================*/ | |
292 | /* Programs used by ICU code */ | |
293 | /*===========================================================================*/ | |
294 | ||
374ca955 | 295 | #ifndef U_MAKE |
b75a7d8f | 296 | #define U_MAKE "nmake" |
374ca955 A |
297 | #define U_MAKE_IS_NMAKE 1 |
298 | #endif |