]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/unicode/utf_old.h
ICU-8.11.4.tar.gz
[apple/icu.git] / icuSources / common / unicode / utf_old.h
index f1df17516d3d6bfdd32c94ed43522d747e65ce3a..2397889960ebced8b950f534deac01c54ce4b30f 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 2002-2003, International Business Machines
+*   Copyright (C) 2002-2005, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
 */
 
 /**
- * \file
+ * \file 
+ * \brief C API: Deprecated macros for Unicode string handling
+ */
+
+/**
+ * 
  * The macros in utf_old.h are all deprecated and their use discouraged.
  * Some of the design principles behind the set of UTF macros
  * have changed or proved impractical.
  * accordingly. UTF-16 was the default.</p>
  *
  * <p>This concept has been abandoned.
- * A lot of the ICU source code &mdash; especially low-level code like
- * conversion, normalization, and collation &mdash; assumes UTF-16,
- * utf.h enforces the default of UTF-16.
+ * A lot of the ICU source code assumes UChar strings are in UTF-16.
+ * This is especially true for low-level code like
+ * conversion, normalization, and collation.
+ * The utf.h header enforces the default of UTF-16.
  * The UTF-8 and UTF-32 macros remain for now for completeness and backward compatibility.</p>
  *
  * <p>Accordingly, utf.h defines UChar to be an unsigned 16-bit integer. If this matches wchar_t, then
  * @deprecated ICU 2.4. Use the macros in utf.h, utf16.h, utf8.h instead.
  */
 
+#ifndef __UTF_OLD_H__
+#define __UTF_OLD_H__
+
+#ifndef U_HIDE_DEPRECATED_API
+
 /* utf.h must be included first. */
 #ifndef __UTF_H__
 #   include "unicode/utf.h"
 #endif
 
-#ifndef __UTF_OLD_H__
-#define __UTF_OLD_H__
-
 /* Formerly utf.h, part 1 --------------------------------------------------- */
 
 #ifdef U_USE_UTF_DEPRECATES
@@ -324,16 +332,16 @@ typedef int32_t UTextOffset;
 
 /** @deprecated ICU 2.4. Renamed to U8_GET_UNSAFE, see utf_old.h. */
 #define UTF8_GET_CHAR_UNSAFE(s, i, c) { \
-    int32_t __I=(int32_t)(i); \
-    UTF8_SET_CHAR_START_UNSAFE(s, __I); \
-    UTF8_NEXT_CHAR_UNSAFE(s, __I, c); \
+    int32_t _utf8_get_char_unsafe_index=(int32_t)(i); \
+    UTF8_SET_CHAR_START_UNSAFE(s, _utf8_get_char_unsafe_index); \
+    UTF8_NEXT_CHAR_UNSAFE(s, _utf8_get_char_unsafe_index, c); \
 }
 
 /** @deprecated ICU 2.4. Use U8_GET instead, see utf_old.h. */
 #define UTF8_GET_CHAR_SAFE(s, start, i, length, c, strict) { \
-    int32_t __I=(int32_t)(i); \
-    UTF8_SET_CHAR_START_SAFE(s, start, __I); \
-    UTF8_NEXT_CHAR_SAFE(s, __I, length, c, strict); \
+    int32_t _utf8_get_char_safe_index=(int32_t)(i); \
+    UTF8_SET_CHAR_START_SAFE(s, start, _utf8_get_char_safe_index); \
+    UTF8_NEXT_CHAR_SAFE(s, _utf8_get_char_safe_index, length, c, strict); \
 }
 
 /** @deprecated ICU 2.4. Renamed to U8_NEXT_UNSAFE, see utf_old.h. */
@@ -1157,4 +1165,7 @@ typedef int32_t UTextOffset;
  */
 #define UTF_SET_CHAR_LIMIT(s, start, i, length) U16_SET_CP_LIMIT(s, start, i, length)
 
+#endif /* U_HIDE_DEPRECATED_API */
+
 #endif
+