ICU 4.8.1.1  4.8.1.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-2011, International Business Machines
5 * Corporation and others. All Rights Reserved.
6 *
7 ******************************************************************************
8 *
9 * Note: autoconf creates platform.h from platform.h.in at configure time.
10 *
11 ******************************************************************************
12 *
13 * FILE NAME : platform.h
14 *
15 * Date Name Description
16 * 05/13/98 nos Creation (content moved here from ptypes.h).
17 * 03/02/99 stephen Added AS400 support.
18 * 03/30/99 stephen Added Linux support.
19 * 04/13/99 stephen Reworked for autoconf.
20 ******************************************************************************
21 */
22 
23 #ifndef _PLATFORM_H
24 #define _PLATFORM_H
25 
31 /* This file should be included before uvernum.h. */
32 #if defined(UVERNUM_H)
33 # error Do not include unicode/uvernum.h before #including unicode/platform.h. Instead of unicode/uvernum.h, #include unicode/uversion.h
34 #endif
35 
40 #ifndef UCLN_NO_AUTO_CLEANUP
41 #define UCLN_NO_AUTO_CLEANUP 1
42 #endif
43 
44 #if 0
45 #define CYGWINMSVC
46 #endif
47 
48 /* Need platform.h when using CYGWINMSVC to get definitions above. Ignore everything else. */
49 #ifndef CYGWINMSVC
50 
52 #ifndef U_LINUX
53 #define U_LINUX
54 #endif
55 
61 #ifndef U_HAVE_DIRENT_H
62 #define U_HAVE_DIRENT_H 1
63 #endif
64 
66 #ifndef U_HAVE_INTTYPES_H
67 #define U_HAVE_INTTYPES_H 1
68 #endif
69 
84 #ifndef U_IOSTREAM_SOURCE
85 #define U_IOSTREAM_SOURCE 199711
86 #endif
87 
96 #ifndef U_HAVE_STD_STRING
97 #define U_HAVE_STD_STRING 1
98 #endif
99 
101 #ifndef U_HAVE_INT8_T
102 #define U_HAVE_INT8_T 1
103 #endif
104 
105 #ifndef U_HAVE_UINT8_T
106 #define U_HAVE_UINT8_T 1
107 #endif
108 
109 #ifndef U_HAVE_INT16_T
110 #define U_HAVE_INT16_T 1
111 #endif
112 
113 #ifndef U_HAVE_UINT16_T
114 #define U_HAVE_UINT16_T 1
115 #endif
116 
117 #ifndef U_HAVE_INT32_T
118 #define U_HAVE_INT32_T 1
119 #endif
120 
121 #ifndef U_HAVE_UINT32_T
122 #define U_HAVE_UINT32_T 1
123 #endif
124 
125 #ifndef U_HAVE_INT64_T
126 #define U_HAVE_INT64_T 1
127 #endif
128 
129 #ifndef U_HAVE_UINT64_T
130 #define U_HAVE_UINT64_T 1
131 #endif
132 
135 /*===========================================================================*/
137 /*===========================================================================*/
138 
139 /* Define whether namespace is supported */
140 #ifndef U_HAVE_NAMESPACE
141 #define U_HAVE_NAMESPACE 1
142 #endif
143 
144 /* Determines the endianness of the platform
145  It's done this way in case multiple architectures are being built at once.
146  For example, Darwin supports fat binaries, which can be both PPC and x86 based. */
147 #if defined(BYTE_ORDER) && defined(BIG_ENDIAN)
148 #define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN)
149 #else
150 #define U_IS_BIG_ENDIAN 0
151 #endif
152 
153 /* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
154 #ifndef ICU_USE_THREADS
155 #define ICU_USE_THREADS 1
156 #endif
157 
158 #ifndef U_DEBUG
159 #define U_DEBUG 0
160 #endif
161 
162 #ifndef U_RELEASE
163 #define U_RELEASE 1
164 #endif
165 
166 /* Determine whether to disable renaming or not. This overrides the
167  setting in umachine.h which is for all platforms. */
168 #ifndef U_DISABLE_RENAMING
169 #define U_DISABLE_RENAMING 0
170 #endif
171 
172 /* Determine whether to override new and delete. */
173 #ifndef U_OVERRIDE_CXX_ALLOCATION
174 #define U_OVERRIDE_CXX_ALLOCATION 1
175 #endif
176 /* Determine whether to override placement new and delete for STL. */
177 #ifndef U_HAVE_PLACEMENT_NEW
178 #define U_HAVE_PLACEMENT_NEW 1
179 #endif
180 
181 /* Determine whether to enable tracing. */
182 #ifndef U_ENABLE_TRACING
183 #define U_ENABLE_TRACING 0
184 #endif
185 
190 #ifndef U_ENABLE_DYLOAD
191 #define U_ENABLE_DYLOAD 1
192 #endif
193 
198 #ifndef U_CHECK_DYLOAD
199 #define U_CHECK_DYLOAD 1
200 #endif
201 
202 
204 #ifndef U_DEFAULT_SHOW_DRAFT
205 #define U_DEFAULT_SHOW_DRAFT 1
206 #endif
207 
210 /*===========================================================================*/
212 /*===========================================================================*/
213 
214 #if ((defined(OS390) && (!defined(__CHARSET_LIB) || !__CHARSET_LIB))) || defined(OS400)
215 # define U_CHARSET_FAMILY 1
216 #endif
217 
220 /*===========================================================================*/
222 /*===========================================================================*/
223 
224 #ifndef U_HAVE_WCHAR_H
225 #define U_HAVE_WCHAR_H 1
226 #endif
227 
228 #ifndef U_SIZEOF_WCHAR_T
229 #define U_SIZEOF_WCHAR_T 4
230 #endif
231 
232 #ifndef U_HAVE_WCSCPY
233 #define U_HAVE_WCSCPY 1
234 #endif
235 
248 #ifndef U_GNUC_UTF16_STRING
249 #define U_GNUC_UTF16_STRING 0
250 #endif
251 #if 1 || defined(U_CHECK_UTF16_STRING)
252 #if (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
253  || (defined(__HP_aCC) && __HP_aCC >= 035000) \
254  || (defined(__HP_cc) && __HP_cc >= 111106) \
255  || U_GNUC_UTF16_STRING
256 #define U_DECLARE_UTF16(string) u ## string
257 #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
258 /* || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x580) */
259 /* Sun's C compiler has issues with this notation, and it's unreliable. */
260 #define U_DECLARE_UTF16(string) U ## string
261 #elif U_SIZEOF_WCHAR_T == 2 \
262  && (U_CHARSET_FAMILY == 0 || ((defined(OS390) || defined(OS400)) && defined(__UCS2__)))
263 #define U_DECLARE_UTF16(string) L ## string
264 #endif
265 #endif
266 
269 /*===========================================================================*/
271 /*===========================================================================*/
272 
273 #ifndef U_HAVE_NL_LANGINFO_CODESET
274 #define U_HAVE_NL_LANGINFO_CODESET 1
275 #endif
276 
277 #ifndef U_NL_LANGINFO_CODESET
278 #define U_NL_LANGINFO_CODESET CODESET
279 #endif
280 
281 #if 1
282 #define U_TZSET tzset
283 #endif
284 #if 1
285 #define U_TIMEZONE __timezone
286 #endif
287 #if 1
288 #define U_TZNAME tzname
289 #endif
290 
291 #define U_HAVE_MMAP 1
292 #define U_HAVE_POPEN 1
293 
296 /*===========================================================================*/
298 /*===========================================================================*/
299 
300 #ifdef U_STATIC_IMPLEMENTATION
301 #define U_EXPORT
302 #elif 1
303 #define U_EXPORT __attribute__((visibility("default")))
304 #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
305  || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
306 #define U_EXPORT __global
307 /*#elif defined(__HP_aCC) || defined(__HP_cc)
308 #define U_EXPORT __declspec(dllexport)*/
309 #else
310 #define U_EXPORT
311 #endif
312 
313 /* U_CALLCONV is releated to U_EXPORT2 */
314 #define U_EXPORT2
315 
316 /* cygwin needs to export/import data */
317 #if defined(U_CYGWIN) && !defined(__GNUC__)
318 #define U_IMPORT __declspec(dllimport)
319 #else
320 #define U_IMPORT
321 #endif
322 
323 /* @} */
324 
325 /*===========================================================================*/
327 /*===========================================================================*/
328 
329 #ifndef U_INLINE
330 # ifdef __cplusplus
331 # define U_INLINE inline
332 # else
333 # define U_INLINE __inline__
334 # endif
335 #endif
336 
337 #ifndef U_ALIGN_CODE
338 #define U_ALIGN_CODE(n)
339 #endif
340 
343 /*===========================================================================*/
345 /*===========================================================================*/
346 
351 #ifndef U_HAVE_GCC_ATOMICS
352 #define U_HAVE_GCC_ATOMICS 1
353 #endif
354 
357 /*===========================================================================*/
359 /*===========================================================================*/
360 
365 #ifndef U_MAKE
366 #define U_MAKE "make"
367 #endif
368 
371 #endif /* CYGWINMSVC */
372 
373 /*===========================================================================*/
374 /* Custom icu entry point renaming */
375 /*===========================================================================*/
376 
381 # define U_LIB_SUFFIX_C_NAME
382 
386 # define U_LIB_SUFFIX_C_NAME_STRING ""
387 
391 # define U_HAVE_LIB_SUFFIX 0
392 
393 #if U_HAVE_LIB_SUFFIX
394 # ifndef U_ICU_ENTRY_POINT_RENAME
395 /* Renaming pattern: u_strcpy_41_suffix */
396 # define U_ICU_ENTRY_POINT_RENAME(x) x ## _ ## 48 ##
397 # define U_DEF_ICUDATA_ENTRY_POINT(major, minor) icudt####major##minor##_dat
398 
399 # endif
400 #endif
401 
402 #endif