Home | History | Annotate | Download | only in unicode
      1 /*
      2  ******************************************************************************
      3  *
      4  *   Copyright (C) 1997-2011, International Business Machines
      5  *   Corporation and others.  All Rights Reserved.
      6  *
      7  ******************************************************************************
      8  *
      9  *  FILE NAME : platform.h
     10  *
     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  ******************************************************************************
     17  */
     18 
     19  /**
     20   * \file
     21   * \brief Configuration constants for the Windows platform
     22   */
     23 
     24 /** Define the platform we're on. */
     25 #ifndef U_WINDOWS
     26 #define U_WINDOWS
     27 #endif
     28 
     29 #if defined(__BORLANDC__)
     30 #define U_HAVE_PLACEMENT_NEW 0
     31 #define __STDC_CONSTANT_MACROS
     32 #endif
     33 
     34 /** _MSC_VER is used to detect the Microsoft compiler. */
     35 #if defined(_MSC_VER)
     36 #define U_INT64_IS_LONG_LONG 0
     37 #else
     38 #define U_INT64_IS_LONG_LONG 1
     39 #endif
     40 
     41 /** Define whether inttypes.h is available */
     42 #ifndef U_HAVE_INTTYPES_H
     43 #   if defined(__BORLANDC__)
     44 #       define U_HAVE_INTTYPES_H 1
     45 #   else
     46 #       define U_HAVE_INTTYPES_H 0
     47 #   endif
     48 #endif
     49 
     50 /**
     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
     55  * files.
     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.
     61  *
     62  */
     63 
     64 #ifndef U_IOSTREAM_SOURCE
     65 #define U_IOSTREAM_SOURCE 199711
     66 #endif
     67 
     68 /** @{
     69  * Determines whether specific types are available */
     70 #ifndef U_HAVE_INT8_T
     71 #define U_HAVE_INT8_T U_HAVE_INTTYPES_H
     72 #endif
     73 
     74 #ifndef U_HAVE_UINT8_T
     75 #define U_HAVE_UINT8_T U_HAVE_INTTYPES_H
     76 #endif
     77 
     78 #ifndef U_HAVE_INT16_T
     79 #define U_HAVE_INT16_T U_HAVE_INTTYPES_H
     80 #endif
     81 
     82 #ifndef U_HAVE_UINT16_T
     83 #define U_HAVE_UINT16_T U_HAVE_INTTYPES_H
     84 #endif
     85 
     86 #ifndef U_HAVE_INT32_T
     87 #define U_HAVE_INT32_T U_HAVE_INTTYPES_H
     88 #endif
     89 
     90 #ifndef U_HAVE_UINT32_T
     91 #define U_HAVE_UINT32_T U_HAVE_INTTYPES_H
     92 #endif
     93 
     94 #ifndef U_HAVE_INT64_T
     95 #define U_HAVE_INT64_T U_HAVE_INTTYPES_H
     96 #endif
     97 
     98 #ifndef U_HAVE_UINT64_T
     99 #define U_HAVE_UINT64_T U_HAVE_INTTYPES_H
    100 #endif
    101 
    102 /** @} */
    103 
    104 /** Define 64 bit limits */
    105 #if !U_INT64_IS_LONG_LONG
    106 # ifndef INT64_C
    107 #  define INT64_C(x) ((int64_t)x)
    108 # endif
    109 # ifndef UINT64_C
    110 #  define UINT64_C(x) ((uint64_t)x)
    111 # endif
    112 /** else use the umachine.h definition */
    113 #endif
    114 
    115 /*===========================================================================*/
    116 /** @{
    117  * Generic data types                                                        */
    118 /*===========================================================================*/
    119 
    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 */
    125 
    126 #if ! U_HAVE_INT8_T
    127 typedef signed char int8_t;
    128 #endif
    129 
    130 #if ! U_HAVE_UINT8_T
    131 typedef unsigned char uint8_t;
    132 #endif
    133 
    134 #if ! U_HAVE_INT16_T
    135 typedef signed short int16_t;
    136 #endif
    137 
    138 #if ! U_HAVE_UINT16_T
    139 typedef unsigned short uint16_t;
    140 #endif
    141 
    142 #if ! U_HAVE_INT32_T
    143 typedef signed int int32_t;
    144 #endif
    145 
    146 #if ! U_HAVE_UINT32_T
    147 typedef unsigned int uint32_t;
    148 #endif
    149 
    150 #if ! U_HAVE_INT64_T
    151 #if U_INT64_IS_LONG_LONG
    152     typedef signed long long int64_t;
    153 #else
    154     typedef signed __int64 int64_t;
    155 #endif
    156 #endif
    157 
    158 #if ! U_HAVE_UINT64_T
    159 #if U_INT64_IS_LONG_LONG
    160     typedef unsigned long long uint64_t;
    161 #else
    162     typedef unsigned __int64 uint64_t;
    163 #endif
    164 #endif
    165 #endif
    166 
    167 /**
    168  * @}
    169  */
    170 
    171 /*===========================================================================*/
    172 /** Compiler and environment features                                         */
    173 /*===========================================================================*/
    174 
    175 /** Define whether namespace is supported */
    176 #ifndef U_HAVE_NAMESPACE
    177 #define U_HAVE_NAMESPACE 1
    178 #endif
    179 
    180 /** Determines the endianness of the platform */
    181 #define U_IS_BIG_ENDIAN 0
    182 
    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
    186 #endif
    187 
    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
    191 #endif
    192 
    193 /** Enable or disable debugging options **/
    194 #ifndef U_DEBUG
    195 #ifdef _DEBUG
    196 #define U_DEBUG 1
    197 #else
    198 #define U_DEBUG 0
    199 #endif
    200 #endif
    201 
    202 /** Enable or disable release options **/
    203 #ifndef U_RELEASE
    204 #ifdef NDEBUG
    205 #define U_RELEASE 1
    206 #else
    207 #define U_RELEASE 0
    208 #endif
    209 #endif
    210 
    211 /** Determine whether to disable renaming or not. This overrides the
    212    setting in umachine.h which is for all platforms. */
    213 #ifndef U_DISABLE_RENAMING
    214 #define U_DISABLE_RENAMING 0
    215 #endif
    216 
    217 /** Determine whether to override new and delete. */
    218 #ifndef U_OVERRIDE_CXX_ALLOCATION
    219 #define U_OVERRIDE_CXX_ALLOCATION 1
    220 #endif
    221 /** Determine whether to override placement new and delete for STL. */
    222 #ifndef U_HAVE_PLACEMENT_NEW
    223 #define U_HAVE_PLACEMENT_NEW 1
    224 #endif
    225 /** Determine whether to override new and delete for MFC. */
    226 #if !defined(U_HAVE_DEBUG_LOCATION_NEW) && defined(_MSC_VER)
    227 #define U_HAVE_DEBUG_LOCATION_NEW 1
    228 #endif
    229 
    230 /** Determine whether to enable tracing. */
    231 #ifndef U_ENABLE_TRACING
    232 #define U_ENABLE_TRACING 0
    233 #endif
    234 
    235 /** Do we allow ICU users to use the draft APIs by default? */
    236 #ifndef U_DEFAULT_SHOW_DRAFT
    237 #define U_DEFAULT_SHOW_DRAFT 1
    238 #endif
    239 
    240 /** @{ Define the library suffix in a C syntax. */
    241 #ifndef U_HAVE_LIB_SUFFIX
    242 #define U_HAVE_LIB_SUFFIX 0
    243 #endif
    244 #ifndef U_LIB_SUFFIX_C_NAME
    245 #define U_LIB_SUFFIX_C_NAME
    246 #endif
    247 #ifndef U_LIB_SUFFIX_C_NAME_STRING
    248 #define U_LIB_SUFFIX_C_NAME_STRING ""
    249 #endif
    250 /** @} */
    251 
    252 /*===========================================================================*/
    253 /** @{ Information about wchar support                                           */
    254 /*===========================================================================*/
    255 
    256 #define U_HAVE_WCHAR_H 1
    257 #define U_SIZEOF_WCHAR_T 2
    258 
    259 #define U_HAVE_WCSCPY 1
    260 
    261 /** @} */
    262 
    263 /**
    264  * \def U_DECLARE_UTF16
    265  * Do not use this macro. Use the UNICODE_STRING or U_STRING_DECL macros
    266  * instead.
    267  * @internal
    268  */
    269 #if 1
    270 #define U_DECLARE_UTF16(string) L ## string
    271 #endif
    272 
    273 /*===========================================================================*/
    274 /** @{ Information about POSIX support                                           */
    275 /*===========================================================================*/
    276 
    277 /**
    278  * @internal
    279  */
    280 #if 1
    281 #define U_TZSET         _tzset
    282 #endif
    283 /**
    284  * @internal
    285  */
    286 #if 1
    287 #define U_TIMEZONE      _timezone
    288 #endif
    289 /**
    290  * @internal
    291  */
    292 #if 1
    293 #define U_TZNAME        _tzname
    294 #endif
    295 /**
    296  * @internal
    297  */
    298 #if 1
    299 #define U_DAYLIGHT      _daylight
    300 #endif
    301 
    302 #define U_HAVE_MMAP 0
    303 #define U_HAVE_POPEN 0
    304 
    305 #ifndef U_ENABLE_DYLOAD
    306 #define U_ENABLE_DYLOAD 1
    307 #endif
    308 
    309 
    310 /** @} */
    311 
    312 /*===========================================================================*/
    313 /** @{ Symbol import-export control                                              */
    314 /*===========================================================================*/
    315 
    316 #ifdef U_STATIC_IMPLEMENTATION
    317 #define U_EXPORT
    318 #else
    319 #define U_EXPORT __declspec(dllexport)
    320 #endif
    321 #define U_EXPORT2 __cdecl
    322 #define U_IMPORT __declspec(dllimport)
    323 /** @} */
    324 
    325 /*===========================================================================*/
    326 /** @{ Code alignment and C function inlining                                    */
    327 /*===========================================================================*/
    328 
    329 #ifndef U_INLINE
    330 #   ifdef __cplusplus
    331 #       define U_INLINE inline
    332 #   else
    333 #       define U_INLINE __inline
    334 #   endif
    335 #endif
    336 
    337 #if defined(_MSC_VER) && defined(_M_IX86) && !defined(_MANAGED)
    338 #define U_ALIGN_CODE(val)    __asm      align val
    339 #else
    340 #define U_ALIGN_CODE(val)
    341 #endif
    342 
    343 /**
    344  * Flag for workaround of MSVC 2003 optimization bugs
    345  */
    346 #if defined(_MSC_VER) && (_MSC_VER < 1400)
    347 #define U_HAVE_MSVC_2003_OR_EARLIER
    348 #endif
    349 
    350 
    351 /** @} */
    352 
    353 /*===========================================================================*/
    354 /** @{ Programs used by ICU code                                                 */
    355 /*===========================================================================*/
    356 
    357 #ifndef U_MAKE
    358 #define U_MAKE  "nmake"
    359 #define U_MAKE_IS_NMAKE 1
    360 #endif
    361 
    362 /** @} */
    363 
    364