X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/46f4442e9a5a4f3b98b7c1083586332f6a8a99a4..729e4ab9bc6618bc3d8a898e575df7f4019e29ca:/icuSources/common/unicode/utf16.h diff --git a/icuSources/common/unicode/utf16.h b/icuSources/common/unicode/utf16.h index 719bc043..5079c114 100644 --- a/icuSources/common/unicode/utf16.h +++ b/icuSources/common/unicode/utf16.h @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 1999-2007, International Business Machines +* Copyright (C) 1999-2010, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -82,6 +82,15 @@ */ #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 @@ -194,7 +203,7 @@ (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)); \ } \ } \