]>
Commit | Line | Data |
---|---|---|
b75a7d8f | 1 | /* |
374ca955 | 2 | ****************************************************************************** |
b75a7d8f | 3 | * |
73c04bcf | 4 | * Copyright (C) 1997-2006, International Business Machines |
b75a7d8f A |
5 | * Corporation and others. All Rights Reserved. |
6 | * | |
374ca955 | 7 | ****************************************************************************** |
b75a7d8f A |
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. | |
374ca955 | 16 | ****************************************************************************** |
b75a7d8f A |
17 | */ |
18 | ||
73c04bcf A |
19 | /** |
20 | * \file | |
21 | * \brief Basic types for the platform | |
22 | */ | |
23 | ||
b75a7d8f A |
24 | /* Define the platform we're on. */ |
25 | #ifndef @platform@ | |
26 | #define @platform@ | |
27 | #endif | |
28 | ||
29 | /* Define whether inttypes.h is available */ | |
30 | #ifndef U_HAVE_INTTYPES_H | |
31 | #define U_HAVE_INTTYPES_H @U_HAVE_INTTYPES_H@ | |
32 | #endif | |
33 | ||
34 | /* | |
35 | * Define what support for C++ streams is available. | |
36 | * If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available | |
37 | * (1997711 is the date the ISO/IEC C++ FDIS was published), and then | |
38 | * one should qualify streams using the std namespace in ICU header | |
39 | * files. | |
40 | * If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is | |
41 | * available instead (198506 is the date when Stroustrup published | |
42 | * "An Extensible I/O Facility for C++" at the summer USENIX conference). | |
43 | * If U_IOSTREAM_SOURCE is 0, then C++ streams are not available and | |
44 | * support for them will be silently suppressed in ICU. | |
45 | * | |
46 | */ | |
47 | ||
48 | #ifndef U_IOSTREAM_SOURCE | |
49 | #define U_IOSTREAM_SOURCE @U_IOSTREAM_SOURCE@ | |
50 | #endif | |
51 | ||
52 | /* Determines whether specific types are available */ | |
53 | #ifndef U_HAVE_INT8_T | |
54 | #define U_HAVE_INT8_T @HAVE_INT8_T@ | |
55 | #endif | |
56 | ||
57 | #ifndef U_HAVE_UINT8_T | |
58 | #define U_HAVE_UINT8_T @HAVE_UINT8_T@ | |
59 | #endif | |
60 | ||
61 | #ifndef U_HAVE_INT16_T | |
62 | #define U_HAVE_INT16_T @HAVE_INT16_T@ | |
63 | #endif | |
64 | ||
65 | #ifndef U_HAVE_UINT16_T | |
66 | #define U_HAVE_UINT16_T @HAVE_UINT16_T@ | |
67 | #endif | |
68 | ||
69 | #ifndef U_HAVE_INT32_T | |
70 | #define U_HAVE_INT32_T @HAVE_INT32_T@ | |
71 | #endif | |
72 | ||
73 | #ifndef U_HAVE_UINT32_T | |
74 | #define U_HAVE_UINT32_T @HAVE_UINT32_T@ | |
75 | #endif | |
76 | ||
77 | #ifndef U_HAVE_INT64_T | |
78 | #define U_HAVE_INT64_T @HAVE_INT64_T@ | |
79 | #endif | |
80 | ||
81 | #ifndef U_HAVE_UINT64_T | |
82 | #define U_HAVE_UINT64_T @HAVE_UINT64_T@ | |
83 | #endif | |
84 | ||
b75a7d8f A |
85 | /*===========================================================================*/ |
86 | /* Generic data types */ | |
87 | /*===========================================================================*/ | |
88 | ||
374ca955 A |
89 | #include <sys/types.h> |
90 | ||
b75a7d8f A |
91 | /* If your platform does not have the <inttypes.h> header, you may |
92 | need to edit the typedefs below. */ | |
93 | #if U_HAVE_INTTYPES_H | |
94 | ||
95 | /* autoconf 2.13 sometimes can't properly find the data types in <inttypes.h> */ | |
96 | /* os/390 needs <inttypes.h>, but it doesn't have int8_t, and it sometimes */ | |
97 | /* doesn't have uint8_t depending on the OS version. */ | |
98 | /* So we have this work around. */ | |
99 | #ifdef OS390 | |
100 | /* The features header is needed to get (u)int64_t sometimes. */ | |
101 | #include <features.h> | |
102 | #if ! U_HAVE_INT8_T | |
103 | typedef signed char int8_t; | |
104 | #endif | |
105 | #if !defined(__uint8_t) | |
106 | #define __uint8_t 1 | |
107 | typedef unsigned char uint8_t; | |
108 | #endif | |
109 | #endif /* OS390 */ | |
110 | ||
111 | #include <inttypes.h> | |
112 | ||
113 | #else /* U_HAVE_INTTYPES_H */ | |
114 | ||
b75a7d8f A |
115 | #if ! U_HAVE_INT8_T |
116 | typedef signed char int8_t; | |
117 | #endif | |
118 | ||
119 | #if ! U_HAVE_UINT8_T | |
120 | typedef unsigned char uint8_t; | |
121 | #endif | |
122 | ||
123 | #if ! U_HAVE_INT16_T | |
124 | typedef signed short int16_t; | |
125 | #endif | |
126 | ||
127 | #if ! U_HAVE_UINT16_T | |
128 | typedef unsigned short uint16_t; | |
129 | #endif | |
130 | ||
131 | #if ! U_HAVE_INT32_T | |
374ca955 | 132 | typedef signed int int32_t; |
b75a7d8f A |
133 | #endif |
134 | ||
135 | #if ! U_HAVE_UINT32_T | |
374ca955 | 136 | typedef unsigned int uint32_t; |
b75a7d8f A |
137 | #endif |
138 | ||
139 | #if ! U_HAVE_INT64_T | |
140 | typedef signed long long int64_t; | |
141 | /* else we may not have a 64-bit type */ | |
142 | #endif | |
143 | ||
144 | #if ! U_HAVE_UINT64_T | |
145 | typedef unsigned long long uint64_t; | |
146 | /* else we may not have a 64-bit type */ | |
147 | #endif | |
148 | ||
149 | #endif | |
150 | ||
374ca955 A |
151 | /*===========================================================================*/ |
152 | /* Compiler and environment features */ | |
153 | /*===========================================================================*/ | |
154 | ||
155 | /* Define whether namespace is supported */ | |
156 | #ifndef U_HAVE_NAMESPACE | |
157 | #define U_HAVE_NAMESPACE @U_HAVE_NAMESPACE@ | |
158 | #endif | |
159 | ||
160 | /* Determines the endianness of the platform | |
161 | It's done this way in case multiple architectures are being built at once. | |
162 | For example, Darwin supports fat binaries, which can be both PPC and x86 based. */ | |
163 | #if defined(BYTE_ORDER) && defined(BIG_ENDIAN) | |
164 | #define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN) | |
165 | #else | |
166 | #define U_IS_BIG_ENDIAN @U_IS_BIG_ENDIAN@ | |
167 | #endif | |
168 | ||
169 | /* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */ | |
170 | #define ICU_USE_THREADS @ICU_USE_THREADS@ | |
171 | ||
172 | #ifndef U_DEBUG | |
173 | #define U_DEBUG @ENABLE_DEBUG@ | |
174 | #endif | |
175 | ||
176 | #ifndef U_RELEASE | |
177 | #define U_RELEASE @ENABLE_RELEASE@ | |
178 | #endif | |
179 | ||
180 | /* Determine whether to disable renaming or not. This overrides the | |
181 | setting in umachine.h which is for all platforms. */ | |
182 | #ifndef U_DISABLE_RENAMING | |
183 | #define U_DISABLE_RENAMING @U_DISABLE_RENAMING@ | |
184 | #endif | |
185 | ||
186 | /* Determine whether to override new and delete. */ | |
187 | #ifndef U_OVERRIDE_CXX_ALLOCATION | |
188 | #define U_OVERRIDE_CXX_ALLOCATION @U_OVERRIDE_CXX_ALLOCATION@ | |
189 | #endif | |
190 | /* Determine whether to override placement new and delete for STL. */ | |
191 | #ifndef U_HAVE_PLACEMENT_NEW | |
192 | #define U_HAVE_PLACEMENT_NEW @U_HAVE_PLACEMENT_NEW@ | |
193 | #endif | |
194 | ||
195 | /* Determine whether to enable tracing. */ | |
196 | #ifndef U_ENABLE_TRACING | |
197 | #define U_ENABLE_TRACING @U_ENABLE_TRACING@ | |
198 | #endif | |
199 | ||
73c04bcf A |
200 | /* Do we allow ICU users to use the draft APIs by default? */ |
201 | #ifndef U_DEFAULT_SHOW_DRAFT | |
202 | #define U_DEFAULT_SHOW_DRAFT @U_DEFAULT_SHOW_DRAFT@ | |
203 | #endif | |
204 | ||
374ca955 A |
205 | /* Define the library suffix in a C syntax. */ |
206 | #define U_HAVE_LIB_SUFFIX @U_HAVE_LIB_SUFFIX@ | |
207 | #define U_LIB_SUFFIX_C_NAME @ICULIBSUFFIXCNAME@ | |
208 | #define U_LIB_SUFFIX_C_NAME_STRING "@ICULIBSUFFIXCNAME@" | |
209 | ||
b75a7d8f A |
210 | /*===========================================================================*/ |
211 | /* Character data types */ | |
212 | /*===========================================================================*/ | |
213 | ||
73c04bcf | 214 | #if ((defined(OS390) && (!defined(__CHARSET_LIB) || !__CHARSET_LIB))) || defined(OS400) |
b75a7d8f A |
215 | # define U_CHARSET_FAMILY 1 |
216 | #endif | |
217 | ||
218 | /*===========================================================================*/ | |
219 | /* Information about wchar support */ | |
220 | /*===========================================================================*/ | |
221 | ||
222 | #define U_HAVE_WCHAR_H @U_HAVE_WCHAR_H@ | |
223 | #define U_SIZEOF_WCHAR_T @U_SIZEOF_WCHAR_T@ | |
224 | ||
225 | #define U_HAVE_WCSCPY @U_HAVE_WCSCPY@ | |
226 | ||
227 | /*===========================================================================*/ | |
228 | /* Information about POSIX support */ | |
229 | /*===========================================================================*/ | |
230 | ||
231 | #define U_HAVE_NL_LANGINFO @U_HAVE_NL_LANGINFO@ | |
232 | #define U_HAVE_NL_LANGINFO_CODESET @U_HAVE_NL_LANGINFO_CODESET@ | |
233 | #define U_NL_LANGINFO_CODESET @U_NL_LANGINFO_CODESET@ | |
234 | ||
374ca955 | 235 | #if @U_HAVE_TZSET@ |
b75a7d8f | 236 | #define U_TZSET @U_TZSET@ |
b75a7d8f | 237 | #endif |
374ca955 A |
238 | #if @U_HAVE_TIMEZONE@ |
239 | #define U_TIMEZONE @U_TIMEZONE@ | |
240 | #endif | |
241 | #if @U_HAVE_TZNAME@ | |
b75a7d8f | 242 | #define U_TZNAME @U_TZNAME@ |
374ca955 | 243 | #endif |
b75a7d8f A |
244 | |
245 | #define U_HAVE_MMAP @HAVE_MMAP@ | |
246 | #define U_HAVE_POPEN @U_HAVE_POPEN@ | |
247 | ||
248 | /*===========================================================================*/ | |
249 | /* Symbol import-export control */ | |
250 | /*===========================================================================*/ | |
251 | ||
73c04bcf A |
252 | #if defined(U_DARWIN) && defined(__GNUC__) && (__GNUC__ >= 4) |
253 | #define USE_GCC_VISIBILITY_ATTRIBUTE 1 | |
254 | #endif | |
255 | ||
256 | #ifdef USE_GCC_VISIBILITY_ATTRIBUTE | |
257 | #define U_EXPORT __attribute__((visibility("default"))) | |
258 | #else | |
b75a7d8f | 259 | #define U_EXPORT |
73c04bcf A |
260 | #endif |
261 | ||
b75a7d8f A |
262 | /* U_CALLCONV is releated to U_EXPORT2 */ |
263 | #define U_EXPORT2 | |
264 | ||
265 | /* cygwin needs to export/import data */ | |
266 | #ifdef U_CYGWIN | |
267 | #define U_IMPORT __declspec(dllimport) | |
268 | #else | |
269 | #define U_IMPORT | |
270 | #endif | |
271 | ||
272 | /*===========================================================================*/ | |
273 | /* Code alignment and C function inlining */ | |
274 | /*===========================================================================*/ | |
275 | ||
276 | #ifndef U_INLINE | |
73c04bcf A |
277 | # ifdef __cplusplus |
278 | # define U_INLINE inline | |
279 | # else | |
280 | # define U_INLINE @U_INLINE@ | |
281 | # endif | |
b75a7d8f A |
282 | #endif |
283 | ||
284 | #define U_ALIGN_CODE(n) | |
285 | ||
286 | /*===========================================================================*/ | |
287 | /* Programs used by ICU code */ | |
288 | /*===========================================================================*/ | |
289 | ||
290 | #define U_MAKE "@U_MAKE@" |