Removed
Link Here
|
1 |
--- common/unicode/unistr.h.orig 2017-03-29 04:44:37 UTC |
2 |
+++ common/unicode/unistr.h |
3 |
@@ -117,12 +117,20 @@ class UnicodeStringAppendable; // unicode/appendable. |
4 |
* The string parameter must be a C string literal. |
5 |
* The length of the string, not including the terminating |
6 |
* <code>NUL</code>, must be specified as a constant. |
7 |
+ * The U_STRING_DECL macro should be invoked exactly once for one |
8 |
+ * such string variable before it is used. |
9 |
* @stable ICU 2.0 |
10 |
*/ |
11 |
#if !U_CHAR16_IS_TYPEDEF |
12 |
# define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, u ## cs, _length) |
13 |
+#elif defined(U_DECLARE_UTF16) |
14 |
+# define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const char16_t *)U_DECLARE_UTF16(cs), _length) |
15 |
+#elif U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && (U_CHARSET_FAMILY==U_ASCII_FAMILY || (U_SIZEOF_UCHAR == 2 && defined(U_WCHAR_IS_UTF16))) |
16 |
+# define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const char16_t *)L ## cs, _length) |
17 |
+#elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY |
18 |
+# define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const char16_t *)cs, _length) |
19 |
#else |
20 |
-# define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const char16_t*)u ## cs, _length) |
21 |
+# define UNICODE_STRING(cs, _length) icu::UnicodeString(cs, _length, US_INV) |
22 |
#endif |
23 |
|
24 |
/** |
25 |
@@ -3985,7 +3993,7 @@ UnicodeString::isBufferWritable() const |
26 |
inline const char16_t * |
27 |
UnicodeString::getBuffer() const { |
28 |
if(fUnion.fFields.fLengthAndFlags&(kIsBogus|kOpenGetBuffer)) { |
29 |
- return nullptr; |
30 |
+ return NULL; |
31 |
} else if(fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) { |
32 |
return fUnion.fStackFields.fBuffer; |
33 |
} else { |