]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/unicode/pwin32.h
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 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
101 # define INT64_C(x) ((int64_t)x)
104 # define UINT64_C(x) ((uint64_t)x)
106 /* else use the umachine.h definition */
109 /*===========================================================================*/
110 /* Generic data types */
111 /*===========================================================================*/
113 /* If your platform does not have the <inttypes.h> header, you may
114 need to edit the typedefs below. */
115 #if U_HAVE_INTTYPES_H
116 #include <inttypes.h>
117 #else /* U_HAVE_INTTYPES_H */
120 typedef signed char int8_t;
124 typedef unsigned char uint8_t;
128 typedef signed short int16_t;
131 #if ! U_HAVE_UINT16_T
132 typedef unsigned short uint16_t;
136 typedef signed int int32_t;
139 #if ! U_HAVE_UINT32_T
140 typedef unsigned int uint32_t;
144 #if U_INT64_IS_LONG_LONG
145 typedef signed long long int64_t;
147 typedef signed __int64
int64_t;
151 #if ! U_HAVE_UINT64_T
152 #if U_INT64_IS_LONG_LONG
153 typedef unsigned long long uint64_t;
155 typedef unsigned __int64
uint64_t;
160 /*===========================================================================*/
161 /* Compiler and environment features */
162 /*===========================================================================*/
164 /* Define whether namespace is supported */
165 #ifndef U_HAVE_NAMESPACE
166 #define U_HAVE_NAMESPACE 1
169 /* Determines the endianness of the platform */
170 #define U_IS_BIG_ENDIAN 0
172 /* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
173 #define ICU_USE_THREADS 1
175 /* On strong memory model CPUs (e.g. x86 CPUs), we use a safe & quick double check mutex lock. */
177 Microsoft can define _M_IX86, _M_AMD64 (before Visual Studio 8) or _M_X64 (starting in Visual Studio 8).
178 Intel can define _M_IX86 or _M_X64
180 #if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
181 #define UMTX_STRONG_MEMORY_MODEL 1
200 /* Determine whether to disable renaming or not. This overrides the
201 setting in umachine.h which is for all platforms. */
202 #ifndef U_DISABLE_RENAMING
203 #define U_DISABLE_RENAMING 0
206 /* Determine whether to override new and delete. */
207 #ifndef U_OVERRIDE_CXX_ALLOCATION
208 #define U_OVERRIDE_CXX_ALLOCATION 1
210 /* Determine whether to override placement new and delete for STL. */
211 #ifndef U_HAVE_PLACEMENT_NEW
212 #define U_HAVE_PLACEMENT_NEW 1
214 /* Determine whether to override new and delete for MFC. */
215 #if !defined(U_HAVE_DEBUG_LOCATION_NEW) && defined(_MSC_VER)
216 #define U_HAVE_DEBUG_LOCATION_NEW 1
219 /* Determine whether to enable tracing. */
220 #ifndef U_ENABLE_TRACING
221 #define U_ENABLE_TRACING 0
224 /* Do we allow ICU users to use the draft APIs by default? */
225 #ifndef U_DEFAULT_SHOW_DRAFT
226 #define U_DEFAULT_SHOW_DRAFT 1
229 /* Define the library suffix in a C syntax. */
230 #define U_HAVE_LIB_SUFFIX 0
231 #define U_LIB_SUFFIX_C_NAME
232 #define U_LIB_SUFFIX_C_NAME_STRING ""
234 /*===========================================================================*/
235 /* Information about wchar support */
236 /*===========================================================================*/
238 #define U_HAVE_WCHAR_H 1
239 #define U_SIZEOF_WCHAR_T 2
241 #define U_HAVE_WCSCPY 1
244 * \def U_DECLARE_UTF16
245 * Do not use this macro. Use the UNICODE_STRING or U_STRING_DECL macros
250 #define U_DECLARE_UTF16(string) L ## string
253 /*===========================================================================*/
254 /* Information about POSIX support */
255 /*===========================================================================*/
258 #define U_TZSET _tzset
261 #define U_TIMEZONE _timezone
264 #define U_TZNAME _tzname
267 #define U_DAYLIGHT _daylight
270 #define U_HAVE_MMAP 0
271 #define U_HAVE_POPEN 0
273 /*===========================================================================*/
274 /* Symbol import-export control */
275 /*===========================================================================*/
277 #ifdef U_STATIC_IMPLEMENTATION
280 #define U_EXPORT __declspec(dllexport)
282 #define U_EXPORT2 __cdecl
283 #define U_IMPORT __declspec(dllimport)
285 /*===========================================================================*/
286 /* Code alignment and C function inlining */
287 /*===========================================================================*/
291 # define U_INLINE inline
293 # define U_INLINE __inline
297 #if defined(_MSC_VER) && defined(_M_IX86) && !defined(_MANAGED)
298 #define U_ALIGN_CODE(val) __asm align val
300 #define U_ALIGN_CODE(val)
304 /*===========================================================================*/
305 /* Programs used by ICU code */
306 /*===========================================================================*/
309 #define U_MAKE "nmake"
310 #define U_MAKE_IS_NMAKE 1