]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/unicode/platform.h.in
ICU-400.42.tar.gz
[apple/icu.git] / icuSources / common / unicode / platform.h.in
index e1dcfdc1488bba202e6f0aa78d83c904997dba93..7b4eab2fa66f499591cd0bdece5d87f11780008f 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 1997-2004, International Business Machines
+*   Copyright (C) 1997-2007, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
 ******************************************************************************
 */
 
+/**
+ * \file 
+ * \brief Basic types for the platform 
+ */
+
 /* Define the platform we're on. */
 #ifndef @platform@
 #define @platform@
@@ -164,6 +169,11 @@ typedef unsigned int uint32_t;
 /* 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
@@ -192,6 +202,11 @@ typedef unsigned int uint32_t;
 #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@
@@ -201,7 +216,7 @@ typedef unsigned int uint32_t;
 /* Character data types                                                      */
 /*===========================================================================*/
 
-#if defined(OS390) || defined(OS400)
+#if ((defined(OS390) && (!defined(__CHARSET_LIB) || !__CHARSET_LIB))) || defined(OS400)
 #   define U_CHARSET_FAMILY 1
 #endif
 
@@ -214,11 +229,31 @@ typedef unsigned int uint32_t;
 
 #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@
 
@@ -239,7 +274,17 @@ typedef unsigned int uint32_t;
 /* 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
 
@@ -255,7 +300,11 @@ typedef unsigned int uint32_t;
 /*===========================================================================*/
 
 #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)