diff -ruNp icu.orig/source/common/unicode/char16ptr.h icu/source/common/unicode/char16ptr.h --- icu.orig/source/common/unicode/char16ptr.h 2018-06-21 11:39:21.000000000 +0200 +++ icu/source/common/unicode/char16ptr.h 2018-08-23 19:27:23.581839560 +0200 @@ -59,12 +59,14 @@ public: */ inline Char16Ptr(wchar_t *p); #endif +#ifdef U_HAS_NULLPTR_T /** * nullptr constructor. * @param p nullptr * @stable ICU 59 */ inline Char16Ptr(std::nullptr_t p); +#endif /** * Destructor. * @stable ICU 59 @@ -112,7 +114,9 @@ Char16Ptr::Char16Ptr(uint16_t *p) : p_(c #if U_SIZEOF_WCHAR_T==2 Char16Ptr::Char16Ptr(wchar_t *p) : p_(cast(p)) {} #endif +#ifdef U_HAS_NULLPTR_T Char16Ptr::Char16Ptr(std::nullptr_t p) : p_(p) {} +#endif Char16Ptr::~Char16Ptr() { U_ALIASING_BARRIER(p_); } @@ -128,7 +132,9 @@ Char16Ptr::Char16Ptr(uint16_t *p) { u_.u #if U_SIZEOF_WCHAR_T==2 Char16Ptr::Char16Ptr(wchar_t *p) { u_.wp = p; } #endif +#ifdef U_HAS_NULLPTR_T Char16Ptr::Char16Ptr(std::nullptr_t p) { u_.cp = p; } +#endif Char16Ptr::~Char16Ptr() {} char16_t *Char16Ptr::get() const { return u_.cp; } @@ -164,12 +170,14 @@ public: */ inline ConstChar16Ptr(const wchar_t *p); #endif +#ifdef U_HAS_NULLPTR_T /** * nullptr constructor. * @param p nullptr * @stable ICU 59 */ inline ConstChar16Ptr(const std::nullptr_t p); +#endif /** * Destructor. @@ -218,7 +226,9 @@ ConstChar16Ptr::ConstChar16Ptr(const uin #if U_SIZEOF_WCHAR_T==2 ConstChar16Ptr::ConstChar16Ptr(const wchar_t *p) : p_(cast(p)) {} #endif +#ifdef U_HAS_NULLPTR_T ConstChar16Ptr::ConstChar16Ptr(const std::nullptr_t p) : p_(p) {} +#endif ConstChar16Ptr::~ConstChar16Ptr() { U_ALIASING_BARRIER(p_); } @@ -234,7 +244,9 @@ ConstChar16Ptr::ConstChar16Ptr(const uin #if U_SIZEOF_WCHAR_T==2 ConstChar16Ptr::ConstChar16Ptr(const wchar_t *p) { u_.wp = p; } #endif +#ifdef U_HASH_NULLPTR_T ConstChar16Ptr::ConstChar16Ptr(const std::nullptr_t p) { u_.cp = p; } +#endif ConstChar16Ptr::~ConstChar16Ptr() {} const char16_t *ConstChar16Ptr::get() const { return u_.cp; } diff -ruNp icu.orig/source/common/unicode/platform.h icu/source/common/unicode/platform.h --- icu.orig/source/common/unicode/platform.h 2018-06-21 11:39:21.000000000 +0200 +++ icu/source/common/unicode/platform.h 2018-08-23 19:28:11.562612934 +0200 @@ -482,6 +482,10 @@ namespace std { typedef decltype(nullptr) nullptr_t; }; +# define U_HAS_NULLPTR_T 1 +#elif defined(__cplusplus) && (U_CPLUSPLUS_VERSION >= 11) +# define U_HAS_NULLPTR_T 1 +// else no U_HAS_NULLPTR_T #endif /** diff -ruNp icu.orig/source/common/unicode/umachine.h icu/source/common/unicode/umachine.h --- icu.orig/source/common/unicode/umachine.h 2018-06-21 11:39:21.000000000 +0200 +++ icu/source/common/unicode/umachine.h 2018-08-23 19:24:06.688770067 +0200 @@ -295,7 +295,7 @@ typedef int8_t UBool; * 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) +#if ((U_PLATFORM == U_PF_AIX) || defined(__GNUC__)) && defined(__cplusplus) && (U_CPLUSPLUS_VERSION < 11) // for AIX, uchar.h needs to be included # include # define U_CHAR16_IS_TYPEDEF 1 diff -ruNp icu.orig/source/common/unicode/unistr.h icu/source/common/unicode/unistr.h --- icu.orig/source/common/unicode/unistr.h 2018-06-21 11:39:21.000000000 +0200 +++ icu/source/common/unicode/unistr.h 2018-08-23 19:31:55.790554495 +0200 @@ -3026,6 +3026,7 @@ public: UnicodeString(ConstChar16Ptr(text)) {} #endif +#ifdef U_HAS_NULLPTR_T /** * nullptr_t constructor. * Effectively the same as the default constructor, makes an empty string object. @@ -3037,6 +3038,7 @@ public: * @stable ICU 59 */ UNISTR_FROM_STRING_EXPLICIT inline UnicodeString(const std::nullptr_t text); +#endif /** * char16_t* constructor. @@ -3073,6 +3075,7 @@ public: UnicodeString(ConstChar16Ptr(text), textLength) {} #endif +#ifdef U_HAS_NULLPTR_T /** * nullptr_t constructor. * Effectively the same as the default constructor, makes an empty string object. @@ -3081,6 +3084,7 @@ public: * @stable ICU 59 */ inline UnicodeString(const std::nullptr_t text, int32_t textLength); +#endif /** * Readonly-aliasing char16_t* constructor. @@ -3155,6 +3159,7 @@ public: UnicodeString(Char16Ptr(buffer), buffLength, buffCapacity) {} #endif +#ifdef U_HAS_NULLPTR_T /** * Writable-aliasing nullptr_t constructor. * Effectively the same as the default constructor, makes an empty string object. @@ -3164,6 +3169,7 @@ public: * @stable ICU 59 */ inline UnicodeString(std::nullptr_t buffer, int32_t buffLength, int32_t buffCapacity); +#endif #if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION @@ -3875,6 +3881,7 @@ UnicodeString::UnicodeString() { fUnion.fStackFields.fLengthAndFlags=kShortString; } +#ifdef U_HAS_NULLPTR_T inline UnicodeString::UnicodeString(const std::nullptr_t /*text*/) { fUnion.fStackFields.fLengthAndFlags=kShortString; } @@ -3886,6 +3893,7 @@ inline UnicodeString::UnicodeString(cons inline UnicodeString::UnicodeString(std::nullptr_t /*buffer*/, int32_t /*buffLength*/, int32_t /*buffCapacity*/) { fUnion.fStackFields.fLengthAndFlags=kShortString; } +#endif //======================================== // Read-only implementation methods @@ -3936,7 +3944,11 @@ UnicodeString::isBufferWritable() const inline const char16_t * UnicodeString::getBuffer() const { if(fUnion.fFields.fLengthAndFlags&(kIsBogus|kOpenGetBuffer)) { +#ifdef U_HAS_NULLPTR_T return nullptr; +#else + return 0; +#endif } else if(fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) { return fUnion.fStackFields.fBuffer; } else {