X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/b37bf2e156556c589aea3e1f58a377f2b1189665..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/icu/unicode/utf16.h diff --git a/icu/unicode/utf16.h b/icu/unicode/utf16.h index 7bf3872..5079c11 100644 --- a/icu/unicode/utf16.h +++ b/icu/unicode/utf16.h @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 1999-2004, International Business Machines +* Copyright (C) 1999-2010, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -23,7 +23,7 @@ * and some common definitions. * * For more information see utf.h and the ICU User Guide Strings chapter - * (http://oss.software.ibm.com/icu/userguide/). + * (http://icu-project.org/userguide/strings.html). * * Usage: * ICU coding guidelines for if() statements should be followed when using these macros. @@ -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 @@ -179,7 +188,7 @@ * * @param s const UChar * string * @param start starting string offset (usually 0) - * @param i string offset, start<=i=(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \ + if((i)>(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \ (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \ } \ } \ @@ -243,7 +252,7 @@ * will be returned as the code point. * * @param s const UChar * string - * @param i string offset, i