]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/unicode/platform.h.in
2 ******************************************************************************
4 * Copyright (C) 1997-2007, International Business Machines
5 * Corporation and others. All Rights Reserved.
7 ******************************************************************************
9 * FILE NAME : platform.h
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 ******************************************************************************
21 * \brief Basic types for the platform
24 /* Define the platform we're on. */
29 /* Define whether inttypes.h is available */
30 #ifndef U_HAVE_INTTYPES_H
31 #define U_HAVE_INTTYPES_H @U_HAVE_INTTYPES_H@
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
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.
48 #ifndef U_IOSTREAM_SOURCE
49 #define U_IOSTREAM_SOURCE @U_IOSTREAM_SOURCE@
52 /* Determines whether specific types are available */
54 #define U_HAVE_INT8_T @HAVE_INT8_T@
57 #ifndef U_HAVE_UINT8_T
58 #define U_HAVE_UINT8_T @HAVE_UINT8_T@
61 #ifndef U_HAVE_INT16_T
62 #define U_HAVE_INT16_T @HAVE_INT16_T@
65 #ifndef U_HAVE_UINT16_T
66 #define U_HAVE_UINT16_T @HAVE_UINT16_T@
69 #ifndef U_HAVE_INT32_T
70 #define U_HAVE_INT32_T @HAVE_INT32_T@
73 #ifndef U_HAVE_UINT32_T
74 #define U_HAVE_UINT32_T @HAVE_UINT32_T@
77 #ifndef U_HAVE_INT64_T
78 #define U_HAVE_INT64_T @HAVE_INT64_T@
81 #ifndef U_HAVE_UINT64_T
82 #define U_HAVE_UINT64_T @HAVE_UINT64_T@
85 /*===========================================================================*/
86 /* Generic data types */
87 /*===========================================================================*/
89 #include <sys/types.h>
91 /* If your platform does not have the <inttypes.h> header, you may
92 need to edit the typedefs below. */
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. */
100 /* The features header is needed to get (u)int64_t sometimes. */
101 #include <features.h>
103 typedef signed char int8_t;
105 #if !defined(__uint8_t)
107 typedef unsigned char uint8_t;
111 #include <inttypes.h>
113 #else /* U_HAVE_INTTYPES_H */
116 typedef signed char int8_t;
120 typedef unsigned char uint8_t;
124 typedef signed short int16_t;
127 #if ! U_HAVE_UINT16_T
128 typedef unsigned short uint16_t;
132 typedef signed int int32_t;
135 #if ! U_HAVE_UINT32_T
136 typedef unsigned int uint32_t;
140 typedef signed long long int64_t;
141 /* else we may not have a 64-bit type */
144 #if ! U_HAVE_UINT64_T
145 typedef unsigned long long uint64_t;
146 /* else we may not have a 64-bit type */
151 /*===========================================================================*/
152 /* Compiler and environment features */
153 /*===========================================================================*/
155 /* Define whether namespace is supported */
156 #ifndef U_HAVE_NAMESPACE
157 #define U_HAVE_NAMESPACE @U_HAVE_NAMESPACE@
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)
166 #define U_IS_BIG_ENDIAN @U_IS_BIG_ENDIAN@
169 /* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
170 #define ICU_USE_THREADS @ICU_USE_THREADS@
172 /* On strong memory model CPUs (e.g. x86 CPUs), we use a safe & quick double check lock. */
173 #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
174 #define UMTX_STRONG_MEMORY_MODEL 1
178 #define U_DEBUG @ENABLE_DEBUG@
182 #define U_RELEASE @ENABLE_RELEASE@
185 /* Determine whether to disable renaming or not. This overrides the
186 setting in umachine.h which is for all platforms. */
187 #ifndef U_DISABLE_RENAMING
188 #define U_DISABLE_RENAMING @U_DISABLE_RENAMING@
191 /* Determine whether to override new and delete. */
192 #ifndef U_OVERRIDE_CXX_ALLOCATION
193 #define U_OVERRIDE_CXX_ALLOCATION @U_OVERRIDE_CXX_ALLOCATION@
195 /* Determine whether to override placement new and delete for STL. */
196 #ifndef U_HAVE_PLACEMENT_NEW
197 #define U_HAVE_PLACEMENT_NEW @U_HAVE_PLACEMENT_NEW@
200 /* Determine whether to enable tracing. */
201 #ifndef U_ENABLE_TRACING
202 #define U_ENABLE_TRACING @U_ENABLE_TRACING@
205 /* Do we allow ICU users to use the draft APIs by default? */
206 #ifndef U_DEFAULT_SHOW_DRAFT
207 #define U_DEFAULT_SHOW_DRAFT @U_DEFAULT_SHOW_DRAFT@
210 /* Define the library suffix in a C syntax. */
211 #define U_HAVE_LIB_SUFFIX @U_HAVE_LIB_SUFFIX@
212 #define U_LIB_SUFFIX_C_NAME @ICULIBSUFFIXCNAME@
213 #define U_LIB_SUFFIX_C_NAME_STRING "@ICULIBSUFFIXCNAME@"
215 /*===========================================================================*/
216 /* Character data types */
217 /*===========================================================================*/
219 #if ((defined(OS390) && (!defined(__CHARSET_LIB) || !__CHARSET_LIB))) || defined(OS400)
220 # define U_CHARSET_FAMILY 1
223 /*===========================================================================*/
224 /* Information about wchar support */
225 /*===========================================================================*/
227 #define U_HAVE_WCHAR_H @U_HAVE_WCHAR_H@
228 #define U_SIZEOF_WCHAR_T @U_SIZEOF_WCHAR_T@
230 #define U_HAVE_WCSCPY @U_HAVE_WCSCPY@
233 * \def U_DECLARE_UTF16
234 * Do not use this macro. Use the UNICODE_STRING or U_STRING_DECL macros
238 #if @U_CHECK_UTF16_STRING@ || defined(U_CHECK_UTF16_STRING)
239 #if (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
240 || (defined(__HP_aCC) && __HP_aCC >= 035000) \
241 || (defined(__HP_cc) && __HP_cc >= 111106)
242 #define U_DECLARE_UTF16(string) u ## string
243 #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
244 /* || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x580) */
245 /* Sun's C compiler has issues with this notation, and it's unreliable. */
246 #define U_DECLARE_UTF16(string) U ## string
247 #elif U_SIZEOF_WCHAR_T == 2 \
248 && (U_CHARSET_FAMILY == 0 || ((defined(OS390) || defined(OS400)) && defined(__UCS2__)))
249 #define U_DECLARE_UTF16(string) L ## string
253 /*===========================================================================*/
254 /* Information about POSIX support */
255 /*===========================================================================*/
257 #define U_HAVE_NL_LANGINFO_CODESET @U_HAVE_NL_LANGINFO_CODESET@
258 #define U_NL_LANGINFO_CODESET @U_NL_LANGINFO_CODESET@
261 #define U_TZSET @U_TZSET@
263 #if @U_HAVE_TIMEZONE@
264 #define U_TIMEZONE @U_TIMEZONE@
267 #define U_TZNAME @U_TZNAME@
270 #define U_HAVE_MMAP @HAVE_MMAP@
271 #define U_HAVE_POPEN @U_HAVE_POPEN@
273 /*===========================================================================*/
274 /* Symbol import-export control */
275 /*===========================================================================*/
277 #if @U_USE_GCC_VISIBILITY_ATTRIBUTE@
278 #define U_EXPORT __attribute__((visibility("default")))
279 #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
280 || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
281 #define U_EXPORT __global
282 /*#elif defined(__HP_aCC) || defined(__HP_cc)
283 #define U_EXPORT __declspec(dllexport)*/
288 /* U_CALLCONV is releated to U_EXPORT2 */
291 /* cygwin needs to export/import data */
293 #define U_IMPORT __declspec(dllimport)
298 /*===========================================================================*/
299 /* Code alignment and C function inlining */
300 /*===========================================================================*/
304 # define U_INLINE inline
306 # define U_INLINE @U_INLINE@
310 #define U_ALIGN_CODE(n)
312 /*===========================================================================*/
313 /* Programs used by ICU code */
314 /*===========================================================================*/
316 #define U_MAKE "@U_MAKE@"