1999-12-28 23:39:02 +00:00
|
|
|
/*
|
2007-07-27 03:12:12 +00:00
|
|
|
******************************************************************************
|
|
|
|
*
|
2011-03-29 00:47:41 +00:00
|
|
|
* Copyright (C) 1997-2011, International Business Machines
|
2007-07-27 03:12:12 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
*
|
|
|
|
******************************************************************************
|
|
|
|
*
|
|
|
|
* FILE NAME : platform.h
|
|
|
|
*
|
|
|
|
* Date Name Description
|
|
|
|
* 05/13/98 nos Creation (content moved here from ptypes.h).
|
|
|
|
* 03/02/99 stephen Added AS400 support.
|
|
|
|
* 03/30/99 stephen Added Linux support.
|
|
|
|
* 04/13/99 stephen Reworked for autoconf.
|
|
|
|
******************************************************************************
|
|
|
|
*/
|
1999-12-28 23:39:02 +00:00
|
|
|
|
2005-06-22 22:39:36 +00:00
|
|
|
/**
|
|
|
|
* \file
|
2005-06-23 22:40:22 +00:00
|
|
|
* \brief Configuration constants for the Windows platform
|
2005-06-22 22:39:36 +00:00
|
|
|
*/
|
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** Define the platform we're on. */
|
2005-02-17 00:19:44 +00:00
|
|
|
#ifndef U_WINDOWS
|
|
|
|
#define U_WINDOWS
|
1999-12-28 23:39:02 +00:00
|
|
|
#endif
|
|
|
|
|
2004-10-12 23:24:19 +00:00
|
|
|
#if defined(__BORLANDC__)
|
|
|
|
#define U_HAVE_PLACEMENT_NEW 0
|
|
|
|
#define __STDC_CONSTANT_MACROS
|
|
|
|
#endif
|
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** _MSC_VER is used to detect the Microsoft compiler. */
|
2005-02-28 17:40:43 +00:00
|
|
|
#if defined(_MSC_VER)
|
|
|
|
#define U_INT64_IS_LONG_LONG 0
|
|
|
|
#else
|
|
|
|
#define U_INT64_IS_LONG_LONG 1
|
|
|
|
#endif
|
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** Define whether inttypes.h is available */
|
2004-07-18 09:00:39 +00:00
|
|
|
#ifndef U_HAVE_INTTYPES_H
|
2009-04-22 23:37:04 +00:00
|
|
|
# if defined(__BORLANDC__) || defined(__MINGW32__)
|
|
|
|
# define U_HAVE_INTTYPES_H 1
|
|
|
|
# else
|
|
|
|
# define U_HAVE_INTTYPES_H 0
|
|
|
|
# endif
|
2004-07-18 09:00:39 +00:00
|
|
|
#endif
|
1999-12-28 23:39:02 +00:00
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/**
|
2000-04-25 21:20:01 +00:00
|
|
|
* Define what support for C++ streams is available.
|
2008-10-01 01:24:46 +00:00
|
|
|
* If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available
|
2000-04-25 21:20:01 +00:00
|
|
|
* (1997711 is the date the ISO/IEC C++ FDIS was published), and then
|
|
|
|
* one should qualify streams using the std namespace in ICU header
|
|
|
|
* files.
|
2008-10-01 01:24:46 +00:00
|
|
|
* If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is
|
2000-04-25 21:20:01 +00:00
|
|
|
* available instead (198506 is the date when Stroustrup published
|
|
|
|
* "An Extensible I/O Facility for C++" at the summer USENIX conference).
|
|
|
|
* If U_IOSTREAM_SOURCE is 0, then C++ streams are not available and
|
|
|
|
* support for them will be silently suppressed in ICU.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2000-10-17 22:42:40 +00:00
|
|
|
#ifndef U_IOSTREAM_SOURCE
|
2001-02-02 23:04:59 +00:00
|
|
|
#define U_IOSTREAM_SOURCE 199711
|
2000-10-17 22:42:40 +00:00
|
|
|
#endif
|
2000-04-25 21:20:01 +00:00
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** @{
|
|
|
|
* Determines whether specific types are available */
|
2004-07-18 09:00:39 +00:00
|
|
|
#ifndef U_HAVE_INT8_T
|
2004-10-12 23:24:19 +00:00
|
|
|
#define U_HAVE_INT8_T U_HAVE_INTTYPES_H
|
2003-10-16 21:14:51 +00:00
|
|
|
#endif
|
2003-10-16 18:34:44 +00:00
|
|
|
|
2004-07-18 09:00:39 +00:00
|
|
|
#ifndef U_HAVE_UINT8_T
|
2004-10-12 23:24:19 +00:00
|
|
|
#define U_HAVE_UINT8_T U_HAVE_INTTYPES_H
|
2003-10-16 18:34:44 +00:00
|
|
|
#endif
|
|
|
|
|
2004-07-18 09:00:39 +00:00
|
|
|
#ifndef U_HAVE_INT16_T
|
2004-10-12 23:24:19 +00:00
|
|
|
#define U_HAVE_INT16_T U_HAVE_INTTYPES_H
|
2004-07-18 09:00:39 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef U_HAVE_UINT16_T
|
2004-10-12 23:24:19 +00:00
|
|
|
#define U_HAVE_UINT16_T U_HAVE_INTTYPES_H
|
2004-07-18 09:00:39 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef U_HAVE_INT32_T
|
2004-10-12 23:24:19 +00:00
|
|
|
#define U_HAVE_INT32_T U_HAVE_INTTYPES_H
|
2004-07-18 09:00:39 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef U_HAVE_UINT32_T
|
2004-10-12 23:24:19 +00:00
|
|
|
#define U_HAVE_UINT32_T U_HAVE_INTTYPES_H
|
2004-07-18 09:00:39 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef U_HAVE_INT64_T
|
2004-10-12 23:24:19 +00:00
|
|
|
#define U_HAVE_INT64_T U_HAVE_INTTYPES_H
|
2004-07-18 09:00:39 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef U_HAVE_UINT64_T
|
2004-10-12 23:24:19 +00:00
|
|
|
#define U_HAVE_UINT64_T U_HAVE_INTTYPES_H
|
2004-07-18 09:00:39 +00:00
|
|
|
#endif
|
2001-11-13 02:56:36 +00:00
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** Define 64 bit limits */
|
2005-02-28 17:40:43 +00:00
|
|
|
#if !U_INT64_IS_LONG_LONG
|
2006-01-12 23:58:20 +00:00
|
|
|
# ifndef INT64_C
|
|
|
|
# define INT64_C(x) ((int64_t)x)
|
|
|
|
# endif
|
|
|
|
# ifndef UINT64_C
|
|
|
|
# define UINT64_C(x) ((uint64_t)x)
|
|
|
|
# endif
|
2008-10-01 01:24:46 +00:00
|
|
|
/** else use the umachine.h definition */
|
2005-02-28 17:40:43 +00:00
|
|
|
#endif
|
2003-12-13 00:18:41 +00:00
|
|
|
|
1999-12-28 23:39:02 +00:00
|
|
|
/*===========================================================================*/
|
2008-10-01 01:24:46 +00:00
|
|
|
/** @{
|
|
|
|
* Generic data types */
|
1999-12-28 23:39:02 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** If your platform does not have the <inttypes.h> header, you may
|
1999-12-28 23:39:02 +00:00
|
|
|
need to edit the typedefs below. */
|
2000-06-30 21:35:03 +00:00
|
|
|
#if U_HAVE_INTTYPES_H
|
1999-12-28 23:39:02 +00:00
|
|
|
#include <inttypes.h>
|
2004-07-18 09:00:39 +00:00
|
|
|
#else /* U_HAVE_INTTYPES_H */
|
1999-12-28 23:39:02 +00:00
|
|
|
|
2001-11-13 02:56:36 +00:00
|
|
|
#if ! U_HAVE_INT8_T
|
1999-12-28 23:39:02 +00:00
|
|
|
typedef signed char int8_t;
|
|
|
|
#endif
|
|
|
|
|
2001-11-13 02:56:36 +00:00
|
|
|
#if ! U_HAVE_UINT8_T
|
1999-12-28 23:39:02 +00:00
|
|
|
typedef unsigned char uint8_t;
|
|
|
|
#endif
|
|
|
|
|
2001-11-13 02:56:36 +00:00
|
|
|
#if ! U_HAVE_INT16_T
|
1999-12-28 23:39:02 +00:00
|
|
|
typedef signed short int16_t;
|
|
|
|
#endif
|
|
|
|
|
2001-11-13 02:56:36 +00:00
|
|
|
#if ! U_HAVE_UINT16_T
|
1999-12-28 23:39:02 +00:00
|
|
|
typedef unsigned short uint16_t;
|
|
|
|
#endif
|
|
|
|
|
2001-11-13 02:56:36 +00:00
|
|
|
#if ! U_HAVE_INT32_T
|
2004-05-11 16:51:15 +00:00
|
|
|
typedef signed int int32_t;
|
1999-12-28 23:39:02 +00:00
|
|
|
#endif
|
|
|
|
|
2001-11-13 02:56:36 +00:00
|
|
|
#if ! U_HAVE_UINT32_T
|
2004-05-11 16:51:15 +00:00
|
|
|
typedef unsigned int uint32_t;
|
1999-12-28 23:39:02 +00:00
|
|
|
#endif
|
|
|
|
|
2002-02-27 21:52:11 +00:00
|
|
|
#if ! U_HAVE_INT64_T
|
2005-02-28 17:40:43 +00:00
|
|
|
#if U_INT64_IS_LONG_LONG
|
2004-07-18 09:00:39 +00:00
|
|
|
typedef signed long long int64_t;
|
2005-02-28 17:40:43 +00:00
|
|
|
#else
|
|
|
|
typedef signed __int64 int64_t;
|
2004-07-18 09:00:39 +00:00
|
|
|
#endif
|
2002-02-27 21:52:11 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ! U_HAVE_UINT64_T
|
2005-02-28 17:40:43 +00:00
|
|
|
#if U_INT64_IS_LONG_LONG
|
2004-07-18 09:00:39 +00:00
|
|
|
typedef unsigned long long uint64_t;
|
2005-02-28 17:40:43 +00:00
|
|
|
#else
|
|
|
|
typedef unsigned __int64 uint64_t;
|
2004-07-18 09:00:39 +00:00
|
|
|
#endif
|
2002-02-27 21:52:11 +00:00
|
|
|
#endif
|
1999-12-28 23:39:02 +00:00
|
|
|
#endif
|
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
1999-12-28 23:39:02 +00:00
|
|
|
/*===========================================================================*/
|
2008-10-01 01:24:46 +00:00
|
|
|
/** Compiler and environment features */
|
1999-12-28 23:39:02 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** Define whether namespace is supported */
|
2004-07-18 09:00:39 +00:00
|
|
|
#ifndef U_HAVE_NAMESPACE
|
|
|
|
#define U_HAVE_NAMESPACE 1
|
|
|
|
#endif
|
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** Determines the endianness of the platform */
|
2004-07-18 09:00:39 +00:00
|
|
|
#define U_IS_BIG_ENDIAN 0
|
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
|
2009-08-12 18:57:25 +00:00
|
|
|
#ifndef ICU_USE_THREADS
|
2004-07-18 09:00:39 +00:00
|
|
|
#define ICU_USE_THREADS 1
|
2009-08-12 18:57:25 +00:00
|
|
|
#endif
|
2004-07-18 09:00:39 +00:00
|
|
|
|
2009-09-03 20:40:02 +00:00
|
|
|
/** 0 or 1 to enable or disable auto cleanup of libraries. If undefined, default is: disabled. */
|
|
|
|
#ifndef UCLN_NO_AUTO_CLEANUP
|
|
|
|
#define UCLN_NO_AUTO_CLEANUP 1
|
|
|
|
#endif
|
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** Enable or disable debugging options **/
|
2004-07-18 09:00:39 +00:00
|
|
|
#ifndef U_DEBUG
|
|
|
|
#ifdef _DEBUG
|
|
|
|
#define U_DEBUG 1
|
|
|
|
#else
|
|
|
|
#define U_DEBUG 0
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** Enable or disable release options **/
|
2004-07-18 09:00:39 +00:00
|
|
|
#ifndef U_RELEASE
|
|
|
|
#ifdef NDEBUG
|
|
|
|
#define U_RELEASE 1
|
|
|
|
#else
|
|
|
|
#define U_RELEASE 0
|
|
|
|
#endif
|
|
|
|
#endif
|
2005-02-28 17:40:43 +00:00
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** Determine whether to disable renaming or not. This overrides the
|
2004-07-18 09:00:39 +00:00
|
|
|
setting in umachine.h which is for all platforms. */
|
|
|
|
#ifndef U_DISABLE_RENAMING
|
2009-05-13 19:02:07 +00:00
|
|
|
#define U_DISABLE_RENAMING 0
|
2004-07-18 09:00:39 +00:00
|
|
|
#endif
|
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** Determine whether to override new and delete. */
|
2004-07-18 09:00:39 +00:00
|
|
|
#ifndef U_OVERRIDE_CXX_ALLOCATION
|
|
|
|
#define U_OVERRIDE_CXX_ALLOCATION 1
|
|
|
|
#endif
|
2008-10-01 01:24:46 +00:00
|
|
|
/** Determine whether to override placement new and delete for STL. */
|
2004-07-18 09:00:39 +00:00
|
|
|
#ifndef U_HAVE_PLACEMENT_NEW
|
|
|
|
#define U_HAVE_PLACEMENT_NEW 1
|
|
|
|
#endif
|
2008-10-01 01:24:46 +00:00
|
|
|
/** Determine whether to override new and delete for MFC. */
|
2005-06-15 04:07:47 +00:00
|
|
|
#if !defined(U_HAVE_DEBUG_LOCATION_NEW) && defined(_MSC_VER)
|
|
|
|
#define U_HAVE_DEBUG_LOCATION_NEW 1
|
|
|
|
#endif
|
2004-07-18 09:00:39 +00:00
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** Determine whether to enable tracing. */
|
2004-07-18 09:00:39 +00:00
|
|
|
#ifndef U_ENABLE_TRACING
|
2006-12-05 18:14:24 +00:00
|
|
|
#define U_ENABLE_TRACING 0
|
2005-06-17 06:52:29 +00:00
|
|
|
#endif
|
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** Do we allow ICU users to use the draft APIs by default? */
|
2005-06-17 06:52:29 +00:00
|
|
|
#ifndef U_DEFAULT_SHOW_DRAFT
|
|
|
|
#define U_DEFAULT_SHOW_DRAFT 1
|
2004-07-18 09:00:39 +00:00
|
|
|
#endif
|
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** @{ Define the library suffix in a C syntax. */
|
2009-09-09 18:29:55 +00:00
|
|
|
#ifndef U_HAVE_LIB_SUFFIX
|
2004-07-18 09:00:39 +00:00
|
|
|
#define U_HAVE_LIB_SUFFIX 0
|
2009-09-09 18:29:55 +00:00
|
|
|
#endif
|
|
|
|
#ifndef U_LIB_SUFFIX_C_NAME
|
|
|
|
#define U_LIB_SUFFIX_C_NAME
|
|
|
|
#endif
|
|
|
|
#ifndef U_LIB_SUFFIX_C_NAME_STRING
|
2004-07-18 09:00:39 +00:00
|
|
|
#define U_LIB_SUFFIX_C_NAME_STRING ""
|
2009-09-09 18:29:55 +00:00
|
|
|
#endif
|
2008-10-01 01:24:46 +00:00
|
|
|
/** @} */
|
1999-12-28 23:39:02 +00:00
|
|
|
|
2000-10-06 17:02:22 +00:00
|
|
|
/*===========================================================================*/
|
2008-10-01 01:24:46 +00:00
|
|
|
/** @{ Information about wchar support */
|
2000-10-06 17:02:22 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
|
2004-07-18 09:00:39 +00:00
|
|
|
#define U_HAVE_WCHAR_H 1
|
|
|
|
#define U_SIZEOF_WCHAR_T 2
|
|
|
|
|
|
|
|
#define U_HAVE_WCSCPY 1
|
2000-10-06 17:02:22 +00:00
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** @} */
|
|
|
|
|
2007-05-30 22:28:35 +00:00
|
|
|
/**
|
|
|
|
* \def U_DECLARE_UTF16
|
|
|
|
* Do not use this macro. Use the UNICODE_STRING or U_STRING_DECL macros
|
|
|
|
* instead.
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
#if 1
|
|
|
|
#define U_DECLARE_UTF16(string) L ## string
|
|
|
|
#endif
|
|
|
|
|
2000-10-05 23:41:59 +00:00
|
|
|
/*===========================================================================*/
|
2008-10-01 01:24:46 +00:00
|
|
|
/** @{ Information about POSIX support */
|
2000-10-05 23:41:59 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
|
2010-02-04 20:32:21 +00:00
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
2005-02-28 17:40:43 +00:00
|
|
|
#if 1
|
2001-10-22 21:01:19 +00:00
|
|
|
#define U_TZSET _tzset
|
|
|
|
#endif
|
2010-02-04 20:32:21 +00:00
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
2005-02-28 17:40:43 +00:00
|
|
|
#if 1
|
|
|
|
#define U_TIMEZONE _timezone
|
|
|
|
#endif
|
2010-02-04 20:32:21 +00:00
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
2005-02-28 17:40:43 +00:00
|
|
|
#if 1
|
2001-10-22 21:01:19 +00:00
|
|
|
#define U_TZNAME _tzname
|
2005-02-28 17:40:43 +00:00
|
|
|
#endif
|
2010-02-04 20:32:21 +00:00
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
2006-11-01 09:04:57 +00:00
|
|
|
#if 1
|
|
|
|
#define U_DAYLIGHT _daylight
|
|
|
|
#endif
|
2000-10-05 23:41:59 +00:00
|
|
|
|
2004-07-18 09:00:39 +00:00
|
|
|
#define U_HAVE_MMAP 0
|
|
|
|
#define U_HAVE_POPEN 0
|
2001-11-13 02:56:36 +00:00
|
|
|
|
2010-01-09 02:15:20 +00:00
|
|
|
#ifndef U_ENABLE_DYLOAD
|
|
|
|
#define U_ENABLE_DYLOAD 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** @} */
|
|
|
|
|
1999-12-28 23:39:02 +00:00
|
|
|
/*===========================================================================*/
|
2011-05-26 20:05:39 +00:00
|
|
|
/** @{ Symbol import-export control */
|
1999-12-28 23:39:02 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
|
2004-04-28 03:22:06 +00:00
|
|
|
#ifdef U_STATIC_IMPLEMENTATION
|
|
|
|
#define U_EXPORT
|
|
|
|
#else
|
1999-12-28 23:39:02 +00:00
|
|
|
#define U_EXPORT __declspec(dllexport)
|
2004-04-28 03:22:06 +00:00
|
|
|
#endif
|
2002-07-23 23:20:44 +00:00
|
|
|
#define U_EXPORT2 __cdecl
|
1999-12-28 23:39:02 +00:00
|
|
|
#define U_IMPORT __declspec(dllimport)
|
2008-10-01 01:24:46 +00:00
|
|
|
/** @} */
|
2000-07-11 22:25:51 +00:00
|
|
|
|
2001-05-07 23:01:37 +00:00
|
|
|
/*===========================================================================*/
|
2011-05-26 20:05:39 +00:00
|
|
|
/** @{ Code alignment */
|
2001-05-07 23:01:37 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
|
2005-10-17 21:25:04 +00:00
|
|
|
#if defined(_MSC_VER) && defined(_M_IX86) && !defined(_MANAGED)
|
2001-05-07 23:01:37 +00:00
|
|
|
#define U_ALIGN_CODE(val) __asm align val
|
|
|
|
#else
|
|
|
|
#define U_ALIGN_CODE(val)
|
|
|
|
#endif
|
2005-06-24 23:24:30 +00:00
|
|
|
|
2009-02-02 23:48:53 +00:00
|
|
|
/**
|
|
|
|
* Flag for workaround of MSVC 2003 optimization bugs
|
|
|
|
*/
|
|
|
|
#if defined(_MSC_VER) && (_MSC_VER < 1400)
|
|
|
|
#define U_HAVE_MSVC_2003_OR_EARLIER
|
|
|
|
#endif
|
|
|
|
|
2001-05-07 23:01:37 +00:00
|
|
|
|
2008-10-01 01:24:46 +00:00
|
|
|
/** @} */
|
|
|
|
|
2000-07-11 22:25:51 +00:00
|
|
|
/*===========================================================================*/
|
2011-05-26 20:05:39 +00:00
|
|
|
/** @{ Programs used by ICU code */
|
2000-07-11 22:25:51 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
|
2004-11-02 00:27:43 +00:00
|
|
|
#ifndef U_MAKE
|
2001-03-21 20:44:20 +00:00
|
|
|
#define U_MAKE "nmake"
|
2004-11-02 00:27:43 +00:00
|
|
|
#define U_MAKE_IS_NMAKE 1
|
|
|
|
#endif
|
2008-10-01 01:24:46 +00:00
|
|
|
|
|
|
|
/** @} */
|
|
|
|
|