]>
git.saurik.com Git - apple/javascriptcore.git/blob - icu/unicode/platform.h
2 ******************************************************************************
4 * Copyright (C) 1997-2010, International Business Machines
5 * Corporation and others. All Rights Reserved.
7 ******************************************************************************
9 * Note: autoconf creates platform.h from platform.h.in at configure time.
11 ******************************************************************************
13 * FILE NAME : platform.h
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 ******************************************************************************
28 * \brief Basic types for the platform
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
37 * Determine wheter to enable auto cleanup of libraries.
40 #ifndef UCLN_NO_AUTO_CLEANUP
41 #define UCLN_NO_AUTO_CLEANUP 1
44 /* Need platform.h when using CYGWINMSVC to get definitions above. Ignore everything else. */
47 /** Define the platform we're on. */
53 * \def U_HAVE_DIRENT_H
54 * Define whether dirent.h is available
57 #ifndef U_HAVE_DIRENT_H
58 #define U_HAVE_DIRENT_H 1
61 /** Define whether inttypes.h is available */
62 #ifndef U_HAVE_INTTYPES_H
63 #define U_HAVE_INTTYPES_H 1
67 * Define what support for C++ streams is available.
68 * If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available
69 * (1997711 is the date the ISO/IEC C++ FDIS was published), and then
70 * one should qualify streams using the std namespace in ICU header
72 * If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is
73 * available instead (198506 is the date when Stroustrup published
74 * "An Extensible I/O Facility for C++" at the summer USENIX conference).
75 * If U_IOSTREAM_SOURCE is 0, then C++ streams are not available and
76 * support for them will be silently suppressed in ICU.
80 #ifndef U_IOSTREAM_SOURCE
81 #define U_IOSTREAM_SOURCE 199711
85 * \def U_HAVE_STD_STRING
86 * Define whether the standard C++ (STL) <string> header is available.
87 * For platforms that do not use platform.h and do not define this constant
88 * in their platform-specific headers, std_string.h defaults
89 * U_HAVE_STD_STRING to 1.
92 #ifndef U_HAVE_STD_STRING
93 #define U_HAVE_STD_STRING 1
96 /** @{ Determines whether specific types are available */
98 #define U_HAVE_INT8_T 1
101 #ifndef U_HAVE_UINT8_T
102 #define U_HAVE_UINT8_T 0
105 #ifndef U_HAVE_INT16_T
106 #define U_HAVE_INT16_T 1
109 #ifndef U_HAVE_UINT16_T
110 #define U_HAVE_UINT16_T 0
113 #ifndef U_HAVE_INT32_T
114 #define U_HAVE_INT32_T 1
117 #ifndef U_HAVE_UINT32_T
118 #define U_HAVE_UINT32_T 0
121 #ifndef U_HAVE_INT64_T
122 #define U_HAVE_INT64_T 1
125 #ifndef U_HAVE_UINT64_T
126 #define U_HAVE_UINT64_T 0
131 /*===========================================================================*/
132 /** @{ Compiler and environment features */
133 /*===========================================================================*/
135 /* Define whether namespace is supported */
136 #ifndef U_HAVE_NAMESPACE
137 #define U_HAVE_NAMESPACE 1
140 /* Determines the endianness of the platform
141 It's done this way in case multiple architectures are being built at once.
142 For example, Darwin supports fat binaries, which can be both PPC and x86 based. */
143 #if defined(BYTE_ORDER) && defined(BIG_ENDIAN)
144 #define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN)
146 #define U_IS_BIG_ENDIAN 1
149 /* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
150 #ifndef ICU_USE_THREADS
151 #define ICU_USE_THREADS 1
154 /* On strong memory model CPUs (e.g. x86 CPUs), we use a safe & quick double check lock. */
155 #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
156 #define UMTX_STRONG_MEMORY_MODEL 1
167 /* Determine whether to disable renaming or not. This overrides the
168 setting in umachine.h which is for all platforms. */
169 #ifndef U_DISABLE_RENAMING
170 #define U_DISABLE_RENAMING 1
173 /* Determine whether to override new and delete. */
174 #ifndef U_OVERRIDE_CXX_ALLOCATION
175 #define U_OVERRIDE_CXX_ALLOCATION 1
177 /* Determine whether to override placement new and delete for STL. */
178 #ifndef U_HAVE_PLACEMENT_NEW
179 #define U_HAVE_PLACEMENT_NEW 1
182 /* Determine whether to enable tracing. */
183 #ifndef U_ENABLE_TRACING
184 #define U_ENABLE_TRACING 1
188 * Whether to enable Dynamic loading in ICU
191 #ifndef U_ENABLE_DYLOAD
192 #define U_ENABLE_DYLOAD 1
196 * Whether to test Dynamic loading as an OS capabilty
199 #ifndef U_CHECK_DYLOAD
200 #define U_CHECK_DYLOAD 1
204 /** Do we allow ICU users to use the draft APIs by default? */
205 #ifndef U_DEFAULT_SHOW_DRAFT
206 #define U_DEFAULT_SHOW_DRAFT 1
211 /*===========================================================================*/
212 /** @{ Character data types */
213 /*===========================================================================*/
215 #if ((defined(OS390) && (!defined(__CHARSET_LIB) || !__CHARSET_LIB))) || defined(OS400)
216 # define U_CHARSET_FAMILY 1
221 /*===========================================================================*/
222 /** @{ Information about wchar support */
223 /*===========================================================================*/
225 #ifndef U_HAVE_WCHAR_H
226 #define U_HAVE_WCHAR_H 1
229 #ifndef U_SIZEOF_WCHAR_T
230 #define U_SIZEOF_WCHAR_T 4
233 #ifndef U_HAVE_WCSCPY
234 #define U_HAVE_WCSCPY 1
241 * \def U_DECLARE_UTF16
242 * Do not use this macro. Use the UNICODE_STRING or U_STRING_DECL macros
246 * \def U_GNUC_UTF16_STRING
249 #ifndef U_GNUC_UTF16_STRING
250 #define U_GNUC_UTF16_STRING 0
252 #if 1 || defined(U_CHECK_UTF16_STRING)
253 #if (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
254 || (defined(__HP_aCC) && __HP_aCC >= 035000) \
255 || (defined(__HP_cc) && __HP_cc >= 111106) \
256 || U_GNUC_UTF16_STRING
257 #define U_DECLARE_UTF16(string) u ## string
258 #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
259 /* || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x580) */
260 /* Sun's C compiler has issues with this notation, and it's unreliable. */
261 #define U_DECLARE_UTF16(string) U ## string
262 #elif U_SIZEOF_WCHAR_T == 2 \
263 && (U_CHARSET_FAMILY == 0 || ((defined(OS390) || defined(OS400)) && defined(__UCS2__)))
264 #define U_DECLARE_UTF16(string) L ## string
270 /*===========================================================================*/
271 /** @{ Information about POSIX support */
272 /*===========================================================================*/
274 #ifndef U_HAVE_NL_LANGINFO_CODESET
275 #define U_HAVE_NL_LANGINFO_CODESET 1
278 #ifndef U_NL_LANGINFO_CODESET
279 #define U_NL_LANGINFO_CODESET CODESET
283 #define U_TZSET tzset
286 #define U_TIMEZONE timezone
289 #define U_TZNAME tzname
292 #define U_HAVE_MMAP 1
293 #define U_HAVE_POPEN 1
297 /*===========================================================================*/
298 /** @{ Symbol import-export control */
299 /*===========================================================================*/
302 #define U_EXPORT __attribute__((visibility("default")))
303 #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
304 || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
305 #define U_EXPORT __global
306 /*#elif defined(__HP_aCC) || defined(__HP_cc)
307 #define U_EXPORT __declspec(dllexport)*/
312 /* U_CALLCONV is releated to U_EXPORT2 */
315 /* cygwin needs to export/import data */
316 #if defined(U_CYGWIN) && !defined(__GNUC__)
317 #define U_IMPORT __declspec(dllimport)
324 /*===========================================================================*/
325 /** @{ Code alignment and C function inlining */
326 /*===========================================================================*/
330 # define U_INLINE inline
332 # define U_INLINE __inline__
337 #define U_ALIGN_CODE(n)
342 /*===========================================================================*/
343 /** @{ GCC built in functions for atomic memory operations */
344 /*===========================================================================*/
347 * \def U_HAVE_GCC_ATOMICS
350 #ifndef U_HAVE_GCC_ATOMICS
351 #define U_HAVE_GCC_ATOMICS 1
356 /*===========================================================================*/
357 /** @{ Programs used by ICU code */
358 /*===========================================================================*/
362 * What program to execute to run 'make'
365 #define U_MAKE "/usr/bin/gnumake"
370 #endif /* CYGWINMSVC */
372 /*===========================================================================*/
373 /* Custom icu entry point renaming */
374 /*===========================================================================*/
377 * Define the library suffix with C syntax.
380 # define U_LIB_SUFFIX_C_NAME
382 * Define the library suffix as a string with C syntax
385 # define U_LIB_SUFFIX_C_NAME_STRING ""
387 * 1 if a custom library suffix is set
390 # define U_HAVE_LIB_SUFFIX 0
392 #if U_HAVE_LIB_SUFFIX
393 # ifndef U_ICU_ENTRY_POINT_RENAME
394 /* Renaming pattern: u_strcpy_41_suffix */
395 # define U_ICU_ENTRY_POINT_RENAME(x) x ## _ ## 46 ##
396 # define U_DEF_ICUDATA_ENTRY_POINT(major, minor) icudt####major##minor##_dat