]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/unicode/pwin32.h
2 ******************************************************************************
4 * Copyright (C) 1997-2010, 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 __STDC_CONSTANT_MACROS
34 /** _MSC_VER is used to detect the Microsoft compiler. */
36 #define U_INT64_IS_LONG_LONG 0
38 #define U_INT64_IS_LONG_LONG 1
41 /** Define whether inttypes.h is available */
42 #ifndef U_HAVE_INTTYPES_H
43 # if defined(__BORLANDC__) || defined(__MINGW32__)
44 # define U_HAVE_INTTYPES_H 1
46 # define U_HAVE_INTTYPES_H 0
51 * Define what support for C++ streams is available.
52 * If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available
53 * (1997711 is the date the ISO/IEC C++ FDIS was published), and then
54 * one should qualify streams using the std namespace in ICU header
56 * If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is
57 * available instead (198506 is the date when Stroustrup published
58 * "An Extensible I/O Facility for C++" at the summer USENIX conference).
59 * If U_IOSTREAM_SOURCE is 0, then C++ streams are not available and
60 * support for them will be silently suppressed in ICU.
64 #ifndef U_IOSTREAM_SOURCE
65 #define U_IOSTREAM_SOURCE 199711
69 * Determines whether specific types are available */
71 #define U_HAVE_INT8_T U_HAVE_INTTYPES_H
74 #ifndef U_HAVE_UINT8_T
75 #define U_HAVE_UINT8_T U_HAVE_INTTYPES_H
78 #ifndef U_HAVE_INT16_T
79 #define U_HAVE_INT16_T U_HAVE_INTTYPES_H
82 #ifndef U_HAVE_UINT16_T
83 #define U_HAVE_UINT16_T U_HAVE_INTTYPES_H
86 #ifndef U_HAVE_INT32_T
87 #define U_HAVE_INT32_T U_HAVE_INTTYPES_H
90 #ifndef U_HAVE_UINT32_T
91 #define U_HAVE_UINT32_T U_HAVE_INTTYPES_H
94 #ifndef U_HAVE_INT64_T
95 #define U_HAVE_INT64_T U_HAVE_INTTYPES_H
98 #ifndef U_HAVE_UINT64_T
99 #define U_HAVE_UINT64_T U_HAVE_INTTYPES_H
104 /** Define 64 bit limits */
105 #if !U_INT64_IS_LONG_LONG
107 # define INT64_C(x) ((int64_t)x)
110 # define UINT64_C(x) ((uint64_t)x)
112 /** else use the umachine.h definition */
115 /*===========================================================================*/
117 * Generic data types */
118 /*===========================================================================*/
120 /** If your platform does not have the <inttypes.h> header, you may
121 need to edit the typedefs below. */
122 #if U_HAVE_INTTYPES_H
123 #include <inttypes.h>
124 #else /* U_HAVE_INTTYPES_H */
127 typedef signed char int8_t;
131 typedef unsigned char uint8_t;
135 typedef signed short int16_t;
138 #if ! U_HAVE_UINT16_T
139 typedef unsigned short uint16_t;
143 typedef signed int int32_t;
146 #if ! U_HAVE_UINT32_T
147 typedef unsigned int uint32_t;
151 #if U_INT64_IS_LONG_LONG
152 typedef signed long long int64_t;
154 typedef signed __int64
int64_t;
158 #if ! U_HAVE_UINT64_T
159 #if U_INT64_IS_LONG_LONG
160 typedef unsigned long long uint64_t;
162 typedef unsigned __int64
uint64_t;
171 /*===========================================================================*/
172 /** Compiler and environment features */
173 /*===========================================================================*/
175 /** Define whether namespace is supported */
176 #ifndef U_HAVE_NAMESPACE
177 #define U_HAVE_NAMESPACE 1
180 /** Determines the endianness of the platform */
181 #define U_IS_BIG_ENDIAN 0
183 /** 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
184 #ifndef ICU_USE_THREADS
185 #define ICU_USE_THREADS 1
188 /** 0 or 1 to enable or disable auto cleanup of libraries. If undefined, default is: disabled. */
189 #ifndef UCLN_NO_AUTO_CLEANUP
190 #define UCLN_NO_AUTO_CLEANUP 1
193 /* On strong memory model CPUs (e.g. x86 CPUs), we use a safe & quick double check mutex lock. */
195 Microsoft can define _M_IX86, _M_AMD64 (before Visual Studio 8) or _M_X64 (starting in Visual Studio 8).
196 Intel can define _M_IX86 or _M_X64
198 #if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
199 #define UMTX_STRONG_MEMORY_MODEL 1
202 /** Enable or disable debugging options **/
211 /** Enable or disable release options **/
220 /** Determine whether to disable renaming or not. This overrides the
221 setting in umachine.h which is for all platforms. */
222 #ifndef U_DISABLE_RENAMING
223 #define U_DISABLE_RENAMING 0
226 /** Determine whether to override new and delete. */
227 #ifndef U_OVERRIDE_CXX_ALLOCATION
228 #define U_OVERRIDE_CXX_ALLOCATION 1
230 /** Determine whether to override placement new and delete for STL. */
231 #ifndef U_HAVE_PLACEMENT_NEW
232 #define U_HAVE_PLACEMENT_NEW 1
234 /** Determine whether to override new and delete for MFC. */
235 #if !defined(U_HAVE_DEBUG_LOCATION_NEW) && defined(_MSC_VER)
236 #define U_HAVE_DEBUG_LOCATION_NEW 1
239 /** Determine whether to enable tracing. */
240 #ifndef U_ENABLE_TRACING
241 #define U_ENABLE_TRACING 0
244 /** Do we allow ICU users to use the draft APIs by default? */
245 #ifndef U_DEFAULT_SHOW_DRAFT
246 #define U_DEFAULT_SHOW_DRAFT 1
249 /** @{ Define the library suffix in a C syntax. */
250 #ifndef U_HAVE_LIB_SUFFIX
251 #define U_HAVE_LIB_SUFFIX 0
253 #ifndef U_LIB_SUFFIX_C_NAME
254 #define U_LIB_SUFFIX_C_NAME
256 #ifndef U_LIB_SUFFIX_C_NAME_STRING
257 #define U_LIB_SUFFIX_C_NAME_STRING ""
261 /*===========================================================================*/
262 /** @{ Information about wchar support */
263 /*===========================================================================*/
265 #define U_HAVE_WCHAR_H 1
266 #define U_SIZEOF_WCHAR_T 2
268 #define U_HAVE_WCSCPY 1
273 * \def U_DECLARE_UTF16
274 * Do not use this macro. Use the UNICODE_STRING or U_STRING_DECL macros
279 #define U_DECLARE_UTF16(string) L ## string
282 /*===========================================================================*/
283 /** @{ Information about POSIX support */
284 /*===========================================================================*/
290 #define U_TZSET _tzset
296 #define U_TIMEZONE _timezone
302 #define U_TZNAME _tzname
308 #define U_DAYLIGHT _daylight
311 #define U_HAVE_MMAP 0
312 #define U_HAVE_POPEN 0
314 #ifndef U_ENABLE_DYLOAD
315 #define U_ENABLE_DYLOAD 1
321 /*===========================================================================*/
322 /** @{ Symbol import-export control */
323 /*===========================================================================*/
325 #ifdef U_STATIC_IMPLEMENTATION
328 #define U_EXPORT __declspec(dllexport)
330 #define U_EXPORT2 __cdecl
331 #define U_IMPORT __declspec(dllimport)
334 /*===========================================================================*/
335 /** @{ Code alignment and C function inlining */
336 /*===========================================================================*/
340 # define U_INLINE inline
342 # define U_INLINE __inline
346 #if defined(_MSC_VER) && defined(_M_IX86) && !defined(_MANAGED)
347 #define U_ALIGN_CODE(val) __asm align val
349 #define U_ALIGN_CODE(val)
353 * Flag for workaround of MSVC 2003 optimization bugs
355 #if defined(_MSC_VER) && (_MSC_VER < 1400)
356 #define U_HAVE_MSVC_2003_OR_EARLIER
362 /*===========================================================================*/
363 /** @{ Programs used by ICU code */
364 /*===========================================================================*/
367 #define U_MAKE "nmake"
368 #define U_MAKE_IS_NMAKE 1