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