/*
-*******************************************************************************
+******************************************************************************
*
-* Copyright (C) 1997-2003, International Business Machines
+* Copyright (C) 1997-2007, International Business Machines
* Corporation and others. All Rights Reserved.
*
-*******************************************************************************
+******************************************************************************
*
* FILE NAME : platform.h
*
* 03/02/99 stephen Added AS400 support.
* 03/30/99 stephen Added Linux support.
* 04/13/99 stephen Reworked for autoconf.
-*******************************************************************************
+******************************************************************************
*/
+/**
+ * \file
+ * \brief Basic types for the platform
+ */
+
/* Define the platform we're on. */
#ifndef @platform@
#define @platform@
#define U_HAVE_UINT64_T @HAVE_UINT64_T@
#endif
-
-/* Define whether namespace is supported */
-#ifndef U_HAVE_NAMESPACE
-#define U_HAVE_NAMESPACE @U_HAVE_NAMESPACE@
-#endif
-
-/* Determines the endianness of the platform */
-#define U_IS_BIG_ENDIAN @U_IS_BIG_ENDIAN@
-
-/* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
-#define ICU_USE_THREADS @ICU_USE_THREADS@
-
-/* Determine whether to disable renaming or not. This overrides the
- setting in umachine.h which is for all platforms. */
-#ifndef U_DISABLE_RENAMING
-#define U_DISABLE_RENAMING @U_DISABLE_RENAMING@
-#endif
-
-/* Determine whether to override new and delete. */
-#ifndef U_OVERRIDE_CXX_ALLOCATION
-#define U_OVERRIDE_CXX_ALLOCATION @U_OVERRIDE_CXX_ALLOCATION@
-#endif
-/* Determine whether to override placement new and delete for STL. */
-#ifndef U_HAVE_PLACEMENT_NEW
-#define U_HAVE_PLACEMENT_NEW @U_HAVE_PLACEMENT_NEW@
-#endif
-
-/* Define the library suffix in a C syntax. */
-#define U_HAVE_LIB_SUFFIX @U_HAVE_LIB_SUFFIX@
-#define U_LIB_SUFFIX_C_NAME @ICULIBSUFFIXCNAME@
-#define U_LIB_SUFFIX_C_NAME_STRING "@ICULIBSUFFIXCNAME@"
-
-/*===========================================================================*/
-/* Platform/Language determination */
-/*===========================================================================*/
-
-#ifdef macintosh
-#ifdef XP_MAC
-#undef XP_MAC
-#endif
-#define XP_MAC 1
-#include <string.h>
-#endif
-
/*===========================================================================*/
/* Generic data types */
/*===========================================================================*/
+#include <sys/types.h>
+
/* If your platform does not have the <inttypes.h> header, you may
need to edit the typedefs below. */
#if U_HAVE_INTTYPES_H
#else /* U_HAVE_INTTYPES_H */
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif /* STDC_HEADERS */
-
#if ! U_HAVE_INT8_T
typedef signed char int8_t;
#endif
#endif
#if ! U_HAVE_INT32_T
-# if defined(_LP64)
- typedef signed int int32_t;
-# else
- typedef signed long int32_t;
-# endif
+typedef signed int int32_t;
#endif
#if ! U_HAVE_UINT32_T
-# if defined(_LP64)
- typedef unsigned int uint32_t;
-# else
- typedef unsigned long uint32_t;
-# endif
+typedef unsigned int uint32_t;
#endif
#if ! U_HAVE_INT64_T
#endif
+/*===========================================================================*/
+/* Compiler and environment features */
+/*===========================================================================*/
+
+/* Define whether namespace is supported */
+#ifndef U_HAVE_NAMESPACE
+#define U_HAVE_NAMESPACE @U_HAVE_NAMESPACE@
+#endif
+
+/* Determines the endianness of the platform
+ It's done this way in case multiple architectures are being built at once.
+ For example, Darwin supports fat binaries, which can be both PPC and x86 based. */
+#if defined(BYTE_ORDER) && defined(BIG_ENDIAN)
+#define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN)
+#else
+#define U_IS_BIG_ENDIAN @U_IS_BIG_ENDIAN@
+#endif
+
+/* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
+#define ICU_USE_THREADS @ICU_USE_THREADS@
+
+/* On strong memory model CPUs (e.g. x86 CPUs), we use a safe & quick double check lock. */
+#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
+#define UMTX_STRONG_MEMORY_MODEL 1
+#endif
+
+#ifndef U_DEBUG
+#define U_DEBUG @ENABLE_DEBUG@
+#endif
+
+#ifndef U_RELEASE
+#define U_RELEASE @ENABLE_RELEASE@
+#endif
+
+/* Determine whether to disable renaming or not. This overrides the
+ setting in umachine.h which is for all platforms. */
+#ifndef U_DISABLE_RENAMING
+#define U_DISABLE_RENAMING @U_DISABLE_RENAMING@
+#endif
+
+/* Determine whether to override new and delete. */
+#ifndef U_OVERRIDE_CXX_ALLOCATION
+#define U_OVERRIDE_CXX_ALLOCATION @U_OVERRIDE_CXX_ALLOCATION@
+#endif
+/* Determine whether to override placement new and delete for STL. */
+#ifndef U_HAVE_PLACEMENT_NEW
+#define U_HAVE_PLACEMENT_NEW @U_HAVE_PLACEMENT_NEW@
+#endif
+
+/* Determine whether to enable tracing. */
+#ifndef U_ENABLE_TRACING
+#define U_ENABLE_TRACING @U_ENABLE_TRACING@
+#endif
+
+/* Do we allow ICU users to use the draft APIs by default? */
+#ifndef U_DEFAULT_SHOW_DRAFT
+#define U_DEFAULT_SHOW_DRAFT @U_DEFAULT_SHOW_DRAFT@
+#endif
+
+/* Define the library suffix in a C syntax. */
+#define U_HAVE_LIB_SUFFIX @U_HAVE_LIB_SUFFIX@
+#define U_LIB_SUFFIX_C_NAME @ICULIBSUFFIXCNAME@
+#define U_LIB_SUFFIX_C_NAME_STRING "@ICULIBSUFFIXCNAME@"
+
/*===========================================================================*/
/* Character data types */
/*===========================================================================*/
-#ifdef OS390
+#if ((defined(OS390) && (!defined(__CHARSET_LIB) || !__CHARSET_LIB))) || defined(OS400)
# define U_CHARSET_FAMILY 1
#endif
#define U_HAVE_WCSCPY @U_HAVE_WCSCPY@
+/**
+ * \def U_DECLARE_UTF16
+ * Do not use this macro. Use the UNICODE_STRING or U_STRING_DECL macros
+ * instead.
+ * @internal
+ */
+#if @U_CHECK_UTF16_STRING@ || defined(U_CHECK_UTF16_STRING)
+#if (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
+ || (defined(__HP_aCC) && __HP_aCC >= 035000) \
+ || (defined(__HP_cc) && __HP_cc >= 111106)
+#define U_DECLARE_UTF16(string) u ## string
+#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
+/* || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x580) */
+/* Sun's C compiler has issues with this notation, and it's unreliable. */
+#define U_DECLARE_UTF16(string) U ## string
+#elif U_SIZEOF_WCHAR_T == 2 \
+ && (U_CHARSET_FAMILY == 0 || ((defined(OS390) || defined(OS400)) && defined(__UCS2__)))
+#define U_DECLARE_UTF16(string) L ## string
+#endif
+#endif
+
/*===========================================================================*/
/* Information about POSIX support */
/*===========================================================================*/
-#define U_HAVE_NL_LANGINFO @U_HAVE_NL_LANGINFO@
#define U_HAVE_NL_LANGINFO_CODESET @U_HAVE_NL_LANGINFO_CODESET@
#define U_NL_LANGINFO_CODESET @U_NL_LANGINFO_CODESET@
+#if @U_HAVE_TZSET@
#define U_TZSET @U_TZSET@
-#define U_HAVE_TIMEZONE @U_HAVE_TIMEZONE@
-#if U_HAVE_TIMEZONE
-# define U_TIMEZONE @U_TIMEZONE@
#endif
+#if @U_HAVE_TIMEZONE@
+#define U_TIMEZONE @U_TIMEZONE@
+#endif
+#if @U_HAVE_TZNAME@
#define U_TZNAME @U_TZNAME@
+#endif
#define U_HAVE_MMAP @HAVE_MMAP@
#define U_HAVE_POPEN @U_HAVE_POPEN@
/* Symbol import-export control */
/*===========================================================================*/
+#if @U_USE_GCC_VISIBILITY_ATTRIBUTE@
+#define U_EXPORT __attribute__((visibility("default")))
+#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
+ || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
+#define U_EXPORT __global
+/*#elif defined(__HP_aCC) || defined(__HP_cc)
+#define U_EXPORT __declspec(dllexport)*/
+#else
#define U_EXPORT
+#endif
+
/* U_CALLCONV is releated to U_EXPORT2 */
#define U_EXPORT2
/*===========================================================================*/
#ifndef U_INLINE
-#define U_INLINE @U_INLINE@
+# ifdef __cplusplus
+# define U_INLINE inline
+# else
+# define U_INLINE @U_INLINE@
+# endif
#endif
#define U_ALIGN_CODE(n)
/*===========================================================================*/
#define U_MAKE "@U_MAKE@"
-