Update contrib.
2 ******************************************************************************
4 * Copyright (C) 1997-2005, 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 Configuration constants for the Windows platform
24 /* Define the platform we're on. */
29 #if defined(__BORLANDC__)
30 #define U_HAVE_PLACEMENT_NEW 0
31 #define U_HAVE_INTTYPES_H 1
32 #define __STDC_CONSTANT_MACROS
35 /* _MSC_VER is used to detect the Microsoft compiler. */
37 #define U_INT64_IS_LONG_LONG 0
39 #define U_INT64_IS_LONG_LONG 1
42 /* Define whether inttypes.h is available */
43 #ifndef U_HAVE_INTTYPES_H
44 #define U_HAVE_INTTYPES_H 0
48 * Define what support for C++ streams is available.
49 * If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available
50 * (1997711 is the date the ISO/IEC C++ FDIS was published), and then
51 * one should qualify streams using the std namespace in ICU header
53 * If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is
54 * available instead (198506 is the date when Stroustrup published
55 * "An Extensible I/O Facility for C++" at the summer USENIX conference).
56 * If U_IOSTREAM_SOURCE is 0, then C++ streams are not available and
57 * support for them will be silently suppressed in ICU.
61 #ifndef U_IOSTREAM_SOURCE
62 #define U_IOSTREAM_SOURCE 199711
65 /* Determines whether specific types are available */
67 #define U_HAVE_INT8_T U_HAVE_INTTYPES_H
70 #ifndef U_HAVE_UINT8_T
71 #define U_HAVE_UINT8_T U_HAVE_INTTYPES_H
74 #ifndef U_HAVE_INT16_T
75 #define U_HAVE_INT16_T U_HAVE_INTTYPES_H
78 #ifndef U_HAVE_UINT16_T
79 #define U_HAVE_UINT16_T U_HAVE_INTTYPES_H
82 #ifndef U_HAVE_INT32_T
83 #define U_HAVE_INT32_T U_HAVE_INTTYPES_H
86 #ifndef U_HAVE_UINT32_T
87 #define U_HAVE_UINT32_T U_HAVE_INTTYPES_H
90 #ifndef U_HAVE_INT64_T
91 #define U_HAVE_INT64_T U_HAVE_INTTYPES_H
94 #ifndef U_HAVE_UINT64_T
95 #define U_HAVE_UINT64_T U_HAVE_INTTYPES_H
98 /* Define 64 bit limits */
99 #if !U_INT64_IS_LONG_LONG
100 #define INT64_C(x) ((int64_t)x)
101 #define UINT64_C(x) ((uint64_t)x)
102 /* else use the umachine.h definition */
105 /*===========================================================================*/
106 /* Generic data types */
107 /*===========================================================================*/
109 /* If your platform does not have the <inttypes.h> header, you may
110 need to edit the typedefs below. */
111 #if U_HAVE_INTTYPES_H
112 #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 #if U_INT64_IS_LONG_LONG
141 typedef signed long long int64_t;
143 typedef signed __int64 int64_t;
147 #if ! U_HAVE_UINT64_T
148 #if U_INT64_IS_LONG_LONG
149 typedef unsigned long long uint64_t;
151 typedef unsigned __int64 uint64_t;
156 /*===========================================================================*/
157 /* Compiler and environment features */
158 /*===========================================================================*/
160 /* Define whether namespace is supported */
161 #ifndef U_HAVE_NAMESPACE
162 #define U_HAVE_NAMESPACE 1
165 /* Determines the endianness of the platform */
166 #define U_IS_BIG_ENDIAN 0
168 /* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
169 #define ICU_USE_THREADS 1
171 /* Windows currently only runs on x86 CPUs which currently all have strong memory models. */
172 #define UMTX_STRONG_MEMORY_MODEL 1
190 /* Determine whether to disable renaming or not. This overrides the
191 setting in umachine.h which is for all platforms. */
192 #ifndef U_DISABLE_RENAMING
193 #define U_DISABLE_RENAMING 0
196 /* Determine whether to override new and delete. */
197 #ifndef U_OVERRIDE_CXX_ALLOCATION
198 #define U_OVERRIDE_CXX_ALLOCATION 1
200 /* Determine whether to override placement new and delete for STL. */
201 #ifndef U_HAVE_PLACEMENT_NEW
202 #define U_HAVE_PLACEMENT_NEW 1
204 /* Determine whether to override new and delete for MFC. */
205 #if !defined(U_HAVE_DEBUG_LOCATION_NEW) && defined(_MSC_VER)
206 #define U_HAVE_DEBUG_LOCATION_NEW 1
209 /* Determine whether to enable tracing. */
210 #ifndef U_ENABLE_TRACING
211 #define U_ENABLE_TRACING 1
214 /* Do we allow ICU users to use the draft APIs by default? */
215 #ifndef U_DEFAULT_SHOW_DRAFT
216 #define U_DEFAULT_SHOW_DRAFT 1
219 /* Define the library suffix in a C syntax. */
220 #define U_HAVE_LIB_SUFFIX 0
221 #define U_LIB_SUFFIX_C_NAME
222 #define U_LIB_SUFFIX_C_NAME_STRING ""
224 /*===========================================================================*/
225 /* Information about wchar support */
226 /*===========================================================================*/
228 #define U_HAVE_WCHAR_H 1
229 #define U_SIZEOF_WCHAR_T 2
231 #define U_HAVE_WCSCPY 1
233 /*===========================================================================*/
234 /* Information about POSIX support */
235 /*===========================================================================*/
238 #define U_TZSET _tzset
241 #define U_TIMEZONE _timezone
244 #define U_TZNAME _tzname
247 #define U_HAVE_MMAP 0
248 #define U_HAVE_POPEN 0
250 /*===========================================================================*/
251 /* Symbol import-export control */
252 /*===========================================================================*/
254 #ifdef U_STATIC_IMPLEMENTATION
257 #define U_EXPORT __declspec(dllexport)
259 #define U_EXPORT2 __cdecl
260 #define U_IMPORT __declspec(dllimport)
262 /*===========================================================================*/
263 /* Code alignment and C function inlining */
264 /*===========================================================================*/
268 # define U_INLINE inline
270 # define U_INLINE __inline
274 #if defined(_MSC_VER) && defined(_M_IX86)
275 #define U_ALIGN_CODE(val) __asm align val
277 #define U_ALIGN_CODE(val)
281 /*===========================================================================*/
282 /* Programs used by ICU code */
283 /*===========================================================================*/
286 #define U_MAKE "nmake"
287 #define U_MAKE_IS_NMAKE 1