Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(797)

Unified Diff: source/common/unicode/unistr.h

Issue 314660043: ticket:12766 Escaping source code (Closed) Base URL: svn+ssh://source.icu-project.org/repos/icu/trunk/icu4c/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: source/common/unicode/unistr.h
===================================================================
--- source/common/unicode/unistr.h (revision 39836)
+++ source/common/unicode/unistr.h (working copy)
@@ -119,7 +119,11 @@
* <code>NUL</code>, must be specified as a constant.
* @stable ICU 2.0
*/
-#define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, u ## cs, _length)
+#if !U_CHAR16_IS_TYPEDEF
+# define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, u ## cs, _length)
+#else
+# define UNICODE_STRING(cs, _length) icu::UnicodeString(TRUE, (const char16_t*)u ## cs, _length)
andy.heninger 2017/03/20 20:17:55 How does this fail without this #ifdef? On AIX, wo
srl295 2017/03/20 20:30:34 No, it ends up being an incompatible type. See th
andy.heninger 2017/03/20 21:03:55 Something's going on that I don't understand. I wo
srl295 2017/03/20 21:43:43 without this particular #if, the signature this ma
markus.icu 2017/03/22 16:43:49 This is very weird: It looks like char16_t==uint16
+#endif
/**
* Unicode String literals in C++.
@@ -3002,6 +3006,7 @@
*/
UNISTR_FROM_STRING_EXPLICIT UnicodeString(const char16_t *text);
+#if !U_CHAR16_IS_TYPEDEF
/**
* uint16_t * constructor.
* Delegates to UnicodeString(const char16_t *).
@@ -3014,6 +3019,7 @@
*/
UNISTR_FROM_STRING_EXPLICIT UnicodeString(const uint16_t *text) :
UnicodeString(ConstChar16Ptr(text)) {}
+#endif
#if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN)
/**
@@ -3053,6 +3059,7 @@
UnicodeString(const char16_t *text,
int32_t textLength);
+#if !U_CHAR16_IS_TYPEDEF
/**
* uint16_t * constructor.
* Delegates to UnicodeString(const char16_t *, int32_t).
@@ -3062,6 +3069,7 @@
*/
UnicodeString(const uint16_t *text, int32_t length) :
UnicodeString(ConstChar16Ptr(text), length) {}
+#endif
#if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN)
/**
@@ -3131,6 +3139,7 @@
*/
UnicodeString(char16_t *buffer, int32_t buffLength, int32_t buffCapacity);
+#if !U_CHAR16_IS_TYPEDEF
/**
* Writable-aliasing uint16_t * constructor.
* Delegates to UnicodeString(const char16_t *, int32_t, int32_t).
@@ -3141,6 +3150,7 @@
*/
UnicodeString(uint16_t *buffer, int32_t buffLength, int32_t buffCapacity) :
UnicodeString(Char16Ptr(buffer), buffLength, buffCapacity) {}
+#endif
#if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN)
/**

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b