ICU 4.2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
platform.h
Go to the documentation of this file.
1 /*
2 ******************************************************************************
3 *
4 * Copyright (C) 1997-2009, International Business Machines
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 
19 #ifndef _PLATFORM_H
20 #define _PLATFORM_H
21 
27 /* Define the platform we're on. */
28 #ifndef U_LINUX
29 #define U_LINUX
30 #endif
31 
35 #ifndef U_HAVE_DIRENT_H
36 #define U_HAVE_DIRENT_H 1
37 #endif
38 
40 #ifndef U_HAVE_INTTYPES_H
41 #define U_HAVE_INTTYPES_H 1
42 #endif
43 
58 #ifndef U_IOSTREAM_SOURCE
59 #define U_IOSTREAM_SOURCE 199711
60 #endif
61 
70 #ifndef U_HAVE_STD_STRING
71 #define U_HAVE_STD_STRING 1
72 #endif
73 
75 #ifndef U_HAVE_INT8_T
76 #define U_HAVE_INT8_T 1
77 #endif
78 
79 #ifndef U_HAVE_UINT8_T
80 #define U_HAVE_UINT8_T 1
81 #endif
82 
83 #ifndef U_HAVE_INT16_T
84 #define U_HAVE_INT16_T 1
85 #endif
86 
87 #ifndef U_HAVE_UINT16_T
88 #define U_HAVE_UINT16_T 1
89 #endif
90 
91 #ifndef U_HAVE_INT32_T
92 #define U_HAVE_INT32_T 1
93 #endif
94 
95 #ifndef U_HAVE_UINT32_T
96 #define U_HAVE_UINT32_T 1
97 #endif
98 
99 #ifndef U_HAVE_INT64_T
100 #define U_HAVE_INT64_T 1
101 #endif
102 
103 #ifndef U_HAVE_UINT64_T
104 #define U_HAVE_UINT64_T 1
105 #endif
106 
109 /*===========================================================================*/
111 /*===========================================================================*/
112 
113 #include <sys/types.h>
114 
115 /* If your platform does not have the <inttypes.h> header, you may
116  need to edit the typedefs below. */
117 #if U_HAVE_INTTYPES_H
118 
119 /* autoconf 2.13 sometimes can't properly find the data types in <inttypes.h> */
120 /* os/390 needs <inttypes.h>, but it doesn't have int8_t, and it sometimes */
121 /* doesn't have uint8_t depending on the OS version. */
122 /* So we have this work around. */
123 #ifdef OS390
124 /* The features header is needed to get (u)int64_t sometimes. */
125 #include <features.h>
126 #if ! U_HAVE_INT8_T
127 typedef signed char int8_t;
128 #endif
129 #if !defined(__uint8_t)
130 #define __uint8_t 1
131 typedef unsigned char uint8_t;
132 #endif
133 #endif /* OS390 */
134 
135 #include <inttypes.h>
136 
137 #else /* U_HAVE_INTTYPES_H */
138 
139 #if ! U_HAVE_INT8_T
140 typedef signed char int8_t;
141 #endif
142 
143 #if ! U_HAVE_UINT8_T
144 typedef unsigned char uint8_t;
145 #endif
146 
147 #if ! U_HAVE_INT16_T
148 typedef signed short int16_t;
149 #endif
150 
151 #if ! U_HAVE_UINT16_T
152 typedef unsigned short uint16_t;
153 #endif
154 
155 #if ! U_HAVE_INT32_T
156 typedef signed int int32_t;
157 #endif
158 
159 #if ! U_HAVE_UINT32_T
160 typedef unsigned int uint32_t;
161 #endif
162 
163 #if ! U_HAVE_INT64_T
164  typedef signed long long int64_t;
165 /* else we may not have a 64-bit type */
166 #endif
167 
168 #if ! U_HAVE_UINT64_T
169  typedef unsigned long long uint64_t;
170 /* else we may not have a 64-bit type */
171 #endif
172 
173 #endif
174 
177 /*===========================================================================*/
179 /*===========================================================================*/
180 
181 /* Define whether namespace is supported */
182 #ifndef U_HAVE_NAMESPACE
183 #define U_HAVE_NAMESPACE 1
184 #endif
185 
186 /* Determines the endianness of the platform
187  It's done this way in case multiple architectures are being built at once.
188  For example, Darwin supports fat binaries, which can be both PPC and x86 based. */
189 #if defined(BYTE_ORDER) && defined(BIG_ENDIAN)
190 #define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN)
191 #else
192 #define U_IS_BIG_ENDIAN 0
193 #endif
194 
195 /* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
196 #define ICU_USE_THREADS 1
197 
198 /* On strong memory model CPUs (e.g. x86 CPUs), we use a safe & quick double check lock. */
199 #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
200 #define UMTX_STRONG_MEMORY_MODEL 1
201 #endif
202 
203 #ifndef U_DEBUG
204 #define U_DEBUG 0
205 #endif
206 
207 #ifndef U_RELEASE
208 #define U_RELEASE 1
209 #endif
210 
211 /* Determine whether to disable renaming or not. This overrides the
212  setting in umachine.h which is for all platforms. */
213 #ifndef U_DISABLE_RENAMING
214 #define U_DISABLE_RENAMING 0
215 #endif
216 
217 /* Determine whether to override new and delete. */
218 #ifndef U_OVERRIDE_CXX_ALLOCATION
219 #define U_OVERRIDE_CXX_ALLOCATION 1
220 #endif
221 /* Determine whether to override placement new and delete for STL. */
222 #ifndef U_HAVE_PLACEMENT_NEW
223 #define U_HAVE_PLACEMENT_NEW 1
224 #endif
225 
226 /* Determine whether to enable tracing. */
227 #ifndef U_ENABLE_TRACING
228 #define U_ENABLE_TRACING 0
229 #endif
230 
231 /* Do we allow ICU users to use the draft APIs by default? */
232 #ifndef U_DEFAULT_SHOW_DRAFT
233 #define U_DEFAULT_SHOW_DRAFT 1
234 #endif
235 
236 /* Define the library suffix in a C syntax. */
237 #define U_HAVE_LIB_SUFFIX 0
238 #define U_LIB_SUFFIX_C_NAME
239 #define U_LIB_SUFFIX_C_NAME_STRING ""
240 
243 /*===========================================================================*/
245 /*===========================================================================*/
246 
247 #if ((defined(OS390) && (!defined(__CHARSET_LIB) || !__CHARSET_LIB))) || defined(OS400)
248 # define U_CHARSET_FAMILY 1
249 #endif
250 
253 /*===========================================================================*/
255 /*===========================================================================*/
256 
257 #ifndef U_HAVE_WCHAR_H
258 #define U_HAVE_WCHAR_H 1
259 #endif
260 
261 #ifndef U_SIZEOF_WCHAR_T
262 #define U_SIZEOF_WCHAR_T 4
263 #endif
264 
265 #ifndef U_HAVE_WCSCPY
266 #define U_HAVE_WCSCPY 1
267 #endif
268 
278 #if 1 || defined(U_CHECK_UTF16_STRING)
279 #if (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
280  || (defined(__HP_aCC) && __HP_aCC >= 035000) \
281  || (defined(__HP_cc) && __HP_cc >= 111106)
282 #define U_DECLARE_UTF16(string) u ## string
283 #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
284 /* || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x580) */
285 /* Sun's C compiler has issues with this notation, and it's unreliable. */
286 #define U_DECLARE_UTF16(string) U ## string
287 #elif U_SIZEOF_WCHAR_T == 2 \
288  && (U_CHARSET_FAMILY == 0 || ((defined(OS390) || defined(OS400)) && defined(__UCS2__)))
289 #define U_DECLARE_UTF16(string) L ## string
290 #endif
291 #endif
292 
295 /*===========================================================================*/
297 /*===========================================================================*/
298 
299 #ifndef U_HAVE_NL_LANGINFO_CODESET
300 #define U_HAVE_NL_LANGINFO_CODESET 1
301 #endif
302 
303 #ifndef U_NL_LANGINFO_CODESET
304 #define U_NL_LANGINFO_CODESET CODESET
305 #endif
306 
307 #if 1
308 #define U_TZSET tzset
309 #endif
310 #if 1
311 #define U_TIMEZONE __timezone
312 #endif
313 #if 1
314 #define U_TZNAME tzname
315 #endif
316 
317 #define U_HAVE_MMAP 1
318 #define U_HAVE_POPEN 1
319 
322 /*===========================================================================*/
324 /*===========================================================================*/
325 
326 #if 1
327 #define U_EXPORT __attribute__((visibility("default")))
328 #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
329  || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
330 #define U_EXPORT __global
331 /*#elif defined(__HP_aCC) || defined(__HP_cc)
332 #define U_EXPORT __declspec(dllexport)*/
333 #else
334 #define U_EXPORT
335 #endif
336 
337 /* U_CALLCONV is releated to U_EXPORT2 */
338 #define U_EXPORT2
339 
340 /* cygwin needs to export/import data */
341 #ifdef U_CYGWIN
342 #define U_IMPORT __declspec(dllimport)
343 #else
344 #define U_IMPORT
345 #endif
346 
347 /* @} */
348 
349 /*===========================================================================*/
351 /*===========================================================================*/
352 
353 #ifndef U_INLINE
354 # ifdef __cplusplus
355 # define U_INLINE inline
356 # else
357 # define U_INLINE __inline__
358 # endif
359 #endif
360 
361 #ifndef U_ALIGN_CODE
362 #define U_ALIGN_CODE(n)
363 #endif
364 
367 /*===========================================================================*/
369 /*===========================================================================*/
370 
375 #ifndef U_MAKE
376 #define U_MAKE "/usr/bin/gmake"
377 #endif
378 
381 #endif
unsigned char uint8_t
Define 64 bit limits.
Definition: pwin32.h:131
unsigned int uint32_t
Define 64 bit limits.
Definition: pwin32.h:147
unsigned long long uint64_t
Define 64 bit limits.
Definition: pwin32.h:160
signed short int16_t
Define 64 bit limits.
Definition: pwin32.h:135
signed char int8_t
Define 64 bit limits.
Definition: pwin32.h:127
signed long long int64_t
Define 64 bit limits.
Definition: pwin32.h:152
unsigned short uint16_t
Define 64 bit limits.
Definition: pwin32.h:139
signed int int32_t
Define 64 bit limits.
Definition: pwin32.h:143