sl@0: /* sl@0: ****************************************************************************** sl@0: * sl@0: * Copyright (C) 1997-2005, International Business Machines sl@0: * Corporation and others. All Rights Reserved. sl@0: * sl@0: ****************************************************************************** sl@0: * sl@0: * FILE NAME : platform.h sl@0: * sl@0: * Date Name Description sl@0: * 05/13/98 nos Creation (content moved here from ptypes.h). sl@0: * 03/02/99 stephen Added AS400 support. sl@0: * 03/30/99 stephen Added Linux support. sl@0: * 04/13/99 stephen Reworked for autoconf. sl@0: ****************************************************************************** sl@0: */ sl@0: sl@0: /** sl@0: * \file sl@0: * \brief Configuration constants for the Windows platform sl@0: */ sl@0: sl@0: /* Define the platform we're on. */ sl@0: #ifndef U_WINDOWS sl@0: #define U_WINDOWS sl@0: #endif sl@0: sl@0: #if defined(__BORLANDC__) sl@0: #define U_HAVE_PLACEMENT_NEW 0 sl@0: #define U_HAVE_INTTYPES_H 1 sl@0: #define __STDC_CONSTANT_MACROS sl@0: #endif sl@0: sl@0: /* _MSC_VER is used to detect the Microsoft compiler. */ sl@0: #if defined(_MSC_VER) sl@0: #define U_INT64_IS_LONG_LONG 0 sl@0: #else sl@0: #define U_INT64_IS_LONG_LONG 1 sl@0: #endif sl@0: sl@0: /* Define whether inttypes.h is available */ sl@0: #ifndef U_HAVE_INTTYPES_H sl@0: #define U_HAVE_INTTYPES_H 0 sl@0: #endif sl@0: sl@0: /* sl@0: * Define what support for C++ streams is available. sl@0: * If U_IOSTREAM_SOURCE is set to 199711, then is available sl@0: * (1997711 is the date the ISO/IEC C++ FDIS was published), and then sl@0: * one should qualify streams using the std namespace in ICU header sl@0: * files. sl@0: * If U_IOSTREAM_SOURCE is set to 198506, then is sl@0: * available instead (198506 is the date when Stroustrup published sl@0: * "An Extensible I/O Facility for C++" at the summer USENIX conference). sl@0: * If U_IOSTREAM_SOURCE is 0, then C++ streams are not available and sl@0: * support for them will be silently suppressed in ICU. sl@0: * sl@0: */ sl@0: sl@0: #ifndef U_IOSTREAM_SOURCE sl@0: #define U_IOSTREAM_SOURCE 199711 sl@0: #endif sl@0: sl@0: /* Determines whether specific types are available */ sl@0: #ifndef U_HAVE_INT8_T sl@0: #define U_HAVE_INT8_T U_HAVE_INTTYPES_H sl@0: #endif sl@0: sl@0: #ifndef U_HAVE_UINT8_T sl@0: #define U_HAVE_UINT8_T U_HAVE_INTTYPES_H sl@0: #endif sl@0: sl@0: #ifndef U_HAVE_INT16_T sl@0: #define U_HAVE_INT16_T U_HAVE_INTTYPES_H sl@0: #endif sl@0: sl@0: #ifndef U_HAVE_UINT16_T sl@0: #define U_HAVE_UINT16_T U_HAVE_INTTYPES_H sl@0: #endif sl@0: sl@0: #ifndef U_HAVE_INT32_T sl@0: #define U_HAVE_INT32_T U_HAVE_INTTYPES_H sl@0: #endif sl@0: sl@0: #ifndef U_HAVE_UINT32_T sl@0: #define U_HAVE_UINT32_T U_HAVE_INTTYPES_H sl@0: #endif sl@0: sl@0: #ifndef U_HAVE_INT64_T sl@0: #define U_HAVE_INT64_T U_HAVE_INTTYPES_H sl@0: #endif sl@0: sl@0: #ifndef U_HAVE_UINT64_T sl@0: #define U_HAVE_UINT64_T U_HAVE_INTTYPES_H sl@0: #endif sl@0: sl@0: /* Define 64 bit limits */ sl@0: #if !U_INT64_IS_LONG_LONG sl@0: #define INT64_C(x) ((int64_t)x) sl@0: #define UINT64_C(x) ((uint64_t)x) sl@0: /* else use the umachine.h definition */ sl@0: #endif sl@0: sl@0: /*===========================================================================*/ sl@0: /* Generic data types */ sl@0: /*===========================================================================*/ sl@0: sl@0: /* If your platform does not have the header, you may sl@0: need to edit the typedefs below. */ sl@0: #if U_HAVE_INTTYPES_H sl@0: #include sl@0: #else /* U_HAVE_INTTYPES_H */ sl@0: sl@0: #if ! U_HAVE_INT8_T sl@0: typedef signed char int8_t; sl@0: #endif sl@0: sl@0: #if ! U_HAVE_UINT8_T sl@0: typedef unsigned char uint8_t; sl@0: #endif sl@0: sl@0: #if ! U_HAVE_INT16_T sl@0: typedef signed short int16_t; sl@0: #endif sl@0: sl@0: #if ! U_HAVE_UINT16_T sl@0: typedef unsigned short uint16_t; sl@0: #endif sl@0: sl@0: #if ! U_HAVE_INT32_T sl@0: typedef signed int int32_t; sl@0: #endif sl@0: sl@0: #if ! U_HAVE_UINT32_T sl@0: typedef unsigned int uint32_t; sl@0: #endif sl@0: sl@0: #if ! U_HAVE_INT64_T sl@0: #if U_INT64_IS_LONG_LONG sl@0: typedef signed long long int64_t; sl@0: #else sl@0: typedef signed __int64 int64_t; sl@0: #endif sl@0: #endif sl@0: sl@0: #if ! U_HAVE_UINT64_T sl@0: #if U_INT64_IS_LONG_LONG sl@0: typedef unsigned long long uint64_t; sl@0: #else sl@0: typedef unsigned __int64 uint64_t; sl@0: #endif sl@0: #endif sl@0: #endif sl@0: sl@0: /*===========================================================================*/ sl@0: /* Compiler and environment features */ sl@0: /*===========================================================================*/ sl@0: sl@0: /* Define whether namespace is supported */ sl@0: #ifndef U_HAVE_NAMESPACE sl@0: #define U_HAVE_NAMESPACE 1 sl@0: #endif sl@0: sl@0: /* Determines the endianness of the platform */ sl@0: #define U_IS_BIG_ENDIAN 0 sl@0: sl@0: /* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */ sl@0: #define ICU_USE_THREADS 1 sl@0: sl@0: /* Windows currently only runs on x86 CPUs which currently all have strong memory models. */ sl@0: #define UMTX_STRONG_MEMORY_MODEL 1 sl@0: sl@0: #ifndef U_DEBUG sl@0: #ifdef _DEBUG sl@0: #define U_DEBUG 1 sl@0: #else sl@0: #define U_DEBUG 0 sl@0: #endif sl@0: #endif sl@0: sl@0: #ifndef U_RELEASE sl@0: #ifdef NDEBUG sl@0: #define U_RELEASE 1 sl@0: #else sl@0: #define U_RELEASE 0 sl@0: #endif sl@0: #endif sl@0: sl@0: /* Determine whether to disable renaming or not. This overrides the sl@0: setting in umachine.h which is for all platforms. */ sl@0: #ifndef U_DISABLE_RENAMING sl@0: #define U_DISABLE_RENAMING 0 sl@0: #endif sl@0: sl@0: /* Determine whether to override new and delete. */ sl@0: #ifndef U_OVERRIDE_CXX_ALLOCATION sl@0: #define U_OVERRIDE_CXX_ALLOCATION 1 sl@0: #endif sl@0: /* Determine whether to override placement new and delete for STL. */ sl@0: #ifndef U_HAVE_PLACEMENT_NEW sl@0: #define U_HAVE_PLACEMENT_NEW 1 sl@0: #endif sl@0: /* Determine whether to override new and delete for MFC. */ sl@0: #if !defined(U_HAVE_DEBUG_LOCATION_NEW) && defined(_MSC_VER) sl@0: #define U_HAVE_DEBUG_LOCATION_NEW 1 sl@0: #endif sl@0: sl@0: /* Determine whether to enable tracing. */ sl@0: #ifndef U_ENABLE_TRACING sl@0: #define U_ENABLE_TRACING 1 sl@0: #endif sl@0: sl@0: /* Do we allow ICU users to use the draft APIs by default? */ sl@0: #ifndef U_DEFAULT_SHOW_DRAFT sl@0: #define U_DEFAULT_SHOW_DRAFT 1 sl@0: #endif sl@0: sl@0: /* Define the library suffix in a C syntax. */ sl@0: #define U_HAVE_LIB_SUFFIX 0 sl@0: #define U_LIB_SUFFIX_C_NAME sl@0: #define U_LIB_SUFFIX_C_NAME_STRING "" sl@0: sl@0: /*===========================================================================*/ sl@0: /* Information about wchar support */ sl@0: /*===========================================================================*/ sl@0: sl@0: #define U_HAVE_WCHAR_H 1 sl@0: #define U_SIZEOF_WCHAR_T 2 sl@0: sl@0: #define U_HAVE_WCSCPY 1 sl@0: sl@0: /*===========================================================================*/ sl@0: /* Information about POSIX support */ sl@0: /*===========================================================================*/ sl@0: sl@0: #if 1 sl@0: #define U_TZSET _tzset sl@0: #endif sl@0: #if 1 sl@0: #define U_TIMEZONE _timezone sl@0: #endif sl@0: #if 1 sl@0: #define U_TZNAME _tzname sl@0: #endif sl@0: sl@0: #define U_HAVE_MMAP 0 sl@0: #define U_HAVE_POPEN 0 sl@0: sl@0: /*===========================================================================*/ sl@0: /* Symbol import-export control */ sl@0: /*===========================================================================*/ sl@0: sl@0: #ifdef U_STATIC_IMPLEMENTATION sl@0: #define U_EXPORT sl@0: #else sl@0: #define U_EXPORT __declspec(dllexport) sl@0: #endif sl@0: #define U_EXPORT2 __cdecl sl@0: #define U_IMPORT __declspec(dllimport) sl@0: sl@0: /*===========================================================================*/ sl@0: /* Code alignment and C function inlining */ sl@0: /*===========================================================================*/ sl@0: sl@0: #ifndef U_INLINE sl@0: # ifdef __cplusplus sl@0: # define U_INLINE inline sl@0: # else sl@0: # define U_INLINE __inline sl@0: # endif sl@0: #endif sl@0: sl@0: #if defined(_MSC_VER) && defined(_M_IX86) sl@0: #define U_ALIGN_CODE(val) __asm align val sl@0: #else sl@0: #define U_ALIGN_CODE(val) sl@0: #endif sl@0: sl@0: sl@0: /*===========================================================================*/ sl@0: /* Programs used by ICU code */ sl@0: /*===========================================================================*/ sl@0: sl@0: #ifndef U_MAKE sl@0: #define U_MAKE "nmake" sl@0: #define U_MAKE_IS_NMAKE 1 sl@0: #endif