#define U_SIZEOF_UCHAR 2
/**
- * for AIX, uchar.h needs to be included
+ * \def U_CHAR16_IS_TYPEDEF
+ * If 1, then char16_t is a typedef and not a real type (yet)
+ * @internal
*/
#if (U_PLATFORM == U_PF_AIX) && defined(__cplusplus) &&(U_CPLUSPLUS_VERSION < 11)
+// for AIX, uchar.h needs to be included
# include <uchar.h>
# define U_CHAR16_IS_TYPEDEF 1
#else
* <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)
+#endif
/**
* Unicode String literals in C++.
UnicodeString(ConstChar16Ptr(text)) {}
#endif
-#if !U_NO_NULLPTR_T
/**
* nullptr_t constructor.
* Effectively the same as the default constructor, makes an empty string object.
* @draft ICU 59
*/
UNISTR_FROM_STRING_EXPLICIT inline UnicodeString(const std::nullptr_t text);
-#endif
/**
* char16_t* constructor.
UnicodeString(ConstChar16Ptr(text), length) {}
#endif
-#if !U_NO_NULLPTR_T
/**
* nullptr_t constructor.
* Effectively the same as the default constructor, makes an empty string object.
* @draft ICU 59
*/
inline UnicodeString(const std::nullptr_t text, int32_t length);
-#endif
+
/**
* Readonly-aliasing char16_t* constructor.
* The text will be used for the UnicodeString object, but
UnicodeString(Char16Ptr(buffer), buffLength, buffCapacity) {}
#endif
-#if !U_NO_NULLPTR_T
/**
* Writable-aliasing nullptr_t constructor.
* Effectively the same as the default constructor, makes an empty string object.
* @draft ICU 59
*/
inline UnicodeString(std::nullptr_t buffer, int32_t buffLength, int32_t buffCapacity);
-#endif
#if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION
fUnion.fStackFields.fLengthAndFlags=kShortString;
}
-#if !U_NO_NULLPTR_T
inline UnicodeString::UnicodeString(const std::nullptr_t /*text*/) {
fUnion.fStackFields.fLengthAndFlags=kShortString;
}
inline UnicodeString::UnicodeString(std::nullptr_t /*buffer*/, int32_t /*buffLength*/, int32_t /*buffCapacity*/) {
fUnion.fStackFields.fLengthAndFlags=kShortString;
}
-#endif
//========================================
// Read-only implementation methods
parse.line = -1;
if (uprv_strchr(translit, ':') || uprv_strchr(translit, '>') || uprv_strchr(translit, '<') || uprv_strchr(translit, '>')) {
- t = Transliterator::createFromRules(UnicodeString(u"Uconv"), str, UTRANS_FORWARD, parse, err);
+ t = Transliterator::createFromRules(UNICODE_STRING_SIMPLE("Uconv"), str, UTRANS_FORWARD, parse, err);
} else {
t = Transliterator::createInstance(UnicodeString(translit, -1, US_INV), UTRANS_FORWARD, err);
}