2 ******************************************************************************
4 * Copyright (C) 1997-2004, 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 ******************************************************************************
19 /* Define the platform we're on. */
24 /* Define whether inttypes.h is available */
25 #ifndef U_HAVE_INTTYPES_H
26 #define U_HAVE_INTTYPES_H 1
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
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.
43 #ifndef U_IOSTREAM_SOURCE
44 #define U_IOSTREAM_SOURCE 199711
47 /* Determines whether specific types are available */
49 #define U_HAVE_INT8_T 1
52 #ifndef U_HAVE_UINT8_T
53 #define U_HAVE_UINT8_T 1
56 #ifndef U_HAVE_INT16_T
57 #define U_HAVE_INT16_T 1
60 #ifndef U_HAVE_UINT16_T
61 #define U_HAVE_UINT16_T 1
64 #ifndef U_HAVE_INT32_T
65 #define U_HAVE_INT32_T 1
68 #ifndef U_HAVE_UINT32_T
69 #define U_HAVE_UINT32_T 1
72 #ifndef U_HAVE_INT64_T
73 #define U_HAVE_INT64_T 1
76 #ifndef U_HAVE_UINT64_T
77 #define U_HAVE_UINT64_T 1
80 /*===========================================================================*/
81 /* Generic data types */
82 /*===========================================================================*/
84 #include <sys/types.h>
86 /* If your platform does not have the <inttypes.h> header, you may
87 need to edit the typedefs below. */
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. */
95 /* The features header is needed to get (u)int64_t sometimes. */
98 typedef signed char int8_t;
100 #if !defined(__uint8_t)
102 typedef unsigned char uint8_t;
106 #include <inttypes.h>
108 #else /* U_HAVE_INTTYPES_H */
111 typedef signed char int8_t;
115 typedef unsigned char uint8_t;
119 typedef signed short int16_t;
122 #if ! U_HAVE_UINT16_T
123 typedef unsigned short uint16_t;
127 typedef signed int int32_t;
130 #if ! U_HAVE_UINT32_T
131 typedef unsigned int uint32_t;
135 typedef signed long long int64_t;
136 /* else we may not have a 64-bit type */
139 #if ! U_HAVE_UINT64_T
140 typedef unsigned long long uint64_t;
141 /* else we may not have a 64-bit type */
146 /*===========================================================================*/
147 /* Compiler and environment features */
148 /*===========================================================================*/
150 /* Define whether namespace is supported */
151 #ifndef U_HAVE_NAMESPACE
152 #define U_HAVE_NAMESPACE 1
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)
161 #define U_IS_BIG_ENDIAN 1
164 /* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
165 #define ICU_USE_THREADS 1
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 0
181 /* Determine whether to override new and delete. */
182 #ifndef U_OVERRIDE_CXX_ALLOCATION
183 #define U_OVERRIDE_CXX_ALLOCATION 1
185 /* Determine whether to override placement new and delete for STL. */
186 #ifndef U_HAVE_PLACEMENT_NEW
187 #define U_HAVE_PLACEMENT_NEW 1
190 /* Determine whether to enable tracing. */
191 #ifndef U_ENABLE_TRACING
192 #define U_ENABLE_TRACING 1
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 ""
200 /*===========================================================================*/
201 /* Character data types */
202 /*===========================================================================*/
204 #if ((defined(OS390) && (!defined(__CHARSET_LIB) || !__CHARSET_LIB))) || defined(OS400)
205 # define U_CHARSET_FAMILY 1
208 /*===========================================================================*/
209 /* Information about wchar support */
210 /*===========================================================================*/
212 #define U_HAVE_WCHAR_H 1
213 #define U_SIZEOF_WCHAR_T 4
215 #define U_HAVE_WCSCPY 1
217 /*===========================================================================*/
218 /* Information about POSIX support */
219 /*===========================================================================*/
221 #define U_HAVE_NL_LANGINFO 1
222 #define U_HAVE_NL_LANGINFO_CODESET 1
223 #define U_NL_LANGINFO_CODESET CODESET
226 #define U_TZSET tzset
232 #define U_TZNAME tzname
235 #define U_HAVE_MMAP 1
236 #define U_HAVE_POPEN 1
238 /*===========================================================================*/
239 /* Symbol import-export control */
240 /*===========================================================================*/
243 /* U_CALLCONV is releated to U_EXPORT2 */
246 /* cygwin needs to export/import data */
248 #define U_IMPORT __declspec(dllimport)
253 /*===========================================================================*/
254 /* Code alignment and C function inlining */
255 /*===========================================================================*/
258 #define U_INLINE inline
261 #define U_ALIGN_CODE(n)
263 /*===========================================================================*/
264 /* Programs used by ICU code */
265 /*===========================================================================*/
267 #define U_MAKE "/usr/bin/gnumake"