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