]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/unicode/utf16.h
ICU-461.12.tar.gz
[apple/icu.git] / icuSources / common / unicode / utf16.h
index 719bc043bb2f8fc6e355b7c1d511b4ea21cb9565..5079c1146b3d347230cd698a0e1396897e4845ad 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 1999-2007, International Business Machines
+*   Copyright (C) 1999-2010, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
  */
 #define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
 
+/**
+ * Assuming c is a surrogate code point (U16_IS_SURROGATE(c)),
+ * is it a trail surrogate?
+ * @param c 16-bit code unit
+ * @return TRUE or FALSE
+ * @stable ICU 4.2
+ */
+#define U16_IS_SURROGATE_TRAIL(c) (((c)&0x400)!=0)
+
 /**
  * Helper constant for U16_GET_SUPPLEMENTARY.
  * @internal
                 (c)=U16_GET_SUPPLEMENTARY((c), __c2); \
             } \
         } else { \
-            if((i)-1>=(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \
+            if((i)>(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \
                 (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \
             } \
         } \