]> git.pld-linux.org Git - packages/icu.git/blob - icu-cxx-pre11.patch
fix timezone issue affecting thunderbird 115; rel 2
[packages/icu.git] / icu-cxx-pre11.patch
1 diff -ruNp icu.orig/source/common/unicode/char16ptr.h icu/source/common/unicode/char16ptr.h
2 --- icu.orig/source/common/unicode/char16ptr.h  2018-06-21 11:39:21.000000000 +0200
3 +++ icu/source/common/unicode/char16ptr.h       2018-08-23 19:27:23.581839560 +0200
4 @@ -59,12 +59,14 @@ public:
5       */
6      inline Char16Ptr(wchar_t *p);
7  #endif
8 +#ifdef U_HAS_NULLPTR_T
9      /**
10       * nullptr constructor.
11       * @param p nullptr
12       * @stable ICU 59
13       */
14      inline Char16Ptr(std::nullptr_t p);
15 +#endif
16      /**
17       * Destructor.
18       * @stable ICU 59
19 @@ -112,7 +114,9 @@ Char16Ptr::Char16Ptr(uint16_t *p) : p_(c
20  #if U_SIZEOF_WCHAR_T==2
21  Char16Ptr::Char16Ptr(wchar_t *p) : p_(cast(p)) {}
22  #endif
23 +#ifdef U_HAS_NULLPTR_T
24  Char16Ptr::Char16Ptr(std::nullptr_t p) : p_(p) {}
25 +#endif
26  Char16Ptr::~Char16Ptr() {
27      U_ALIASING_BARRIER(p_);
28  }
29 @@ -128,7 +132,9 @@ Char16Ptr::Char16Ptr(uint16_t *p) { u_.u
30  #if U_SIZEOF_WCHAR_T==2
31  Char16Ptr::Char16Ptr(wchar_t *p) { u_.wp = p; }
32  #endif
33 +#ifdef U_HAS_NULLPTR_T
34  Char16Ptr::Char16Ptr(std::nullptr_t p) { u_.cp = p; }
35 +#endif
36  Char16Ptr::~Char16Ptr() {}
37  
38  char16_t *Char16Ptr::get() const { return u_.cp; }
39 @@ -164,12 +170,14 @@ public:
40       */
41      inline ConstChar16Ptr(const wchar_t *p);
42  #endif
43 +#ifdef U_HAS_NULLPTR_T
44      /**
45       * nullptr constructor.
46       * @param p nullptr
47       * @stable ICU 59
48       */
49      inline ConstChar16Ptr(const std::nullptr_t p);
50 +#endif
51  
52      /**
53       * Destructor.
54 @@ -218,7 +226,9 @@ ConstChar16Ptr::ConstChar16Ptr(const uin
55  #if U_SIZEOF_WCHAR_T==2
56  ConstChar16Ptr::ConstChar16Ptr(const wchar_t *p) : p_(cast(p)) {}
57  #endif
58 +#ifdef U_HAS_NULLPTR_T
59  ConstChar16Ptr::ConstChar16Ptr(const std::nullptr_t p) : p_(p) {}
60 +#endif
61  ConstChar16Ptr::~ConstChar16Ptr() {
62      U_ALIASING_BARRIER(p_);
63  }
64 @@ -234,7 +244,9 @@ ConstChar16Ptr::ConstChar16Ptr(const uin
65  #if U_SIZEOF_WCHAR_T==2
66  ConstChar16Ptr::ConstChar16Ptr(const wchar_t *p) { u_.wp = p; }
67  #endif
68 +#ifdef U_HASH_NULLPTR_T
69  ConstChar16Ptr::ConstChar16Ptr(const std::nullptr_t p) { u_.cp = p; }
70 +#endif
71  ConstChar16Ptr::~ConstChar16Ptr() {}
72  
73  const char16_t *ConstChar16Ptr::get() const { return u_.cp; }
74 diff -ruNp icu.orig/source/common/unicode/platform.h icu/source/common/unicode/platform.h
75 --- icu.orig/source/common/unicode/platform.h   2018-06-21 11:39:21.000000000 +0200
76 +++ icu/source/common/unicode/platform.h        2018-08-23 19:28:11.562612934 +0200
77 @@ -482,6 +482,10 @@
78  namespace std {
79    typedef decltype(nullptr) nullptr_t;
80  };
81 +#   define U_HAS_NULLPTR_T 1
82 +#elif defined(__cplusplus) && (U_CPLUSPLUS_VERSION >= 11)
83 +#   define U_HAS_NULLPTR_T 1
84 +// else no U_HAS_NULLPTR_T
85  #endif
86  
87  /**
88 diff -ruNp icu.orig/source/common/unicode/umachine.h icu/source/common/unicode/umachine.h
89 --- icu.orig/source/common/unicode/umachine.h   2018-06-21 11:39:21.000000000 +0200
90 +++ icu/source/common/unicode/umachine.h        2018-08-23 19:24:06.688770067 +0200
91 @@ -295,7 +295,7 @@ typedef int8_t UBool;
92   * If 1, then char16_t is a typedef and not a real type (yet)
93   * @internal
94   */
95 -#if (U_PLATFORM == U_PF_AIX) && defined(__cplusplus) &&(U_CPLUSPLUS_VERSION < 11)
96 +#if ((U_PLATFORM == U_PF_AIX) || defined(__GNUC__)) && defined(__cplusplus) && (U_CPLUSPLUS_VERSION < 11)
97  // for AIX, uchar.h needs to be included
98  # include <uchar.h>
99  # define U_CHAR16_IS_TYPEDEF 1
100 diff -ruNp icu.orig/source/common/unicode/unistr.h icu/source/common/unicode/unistr.h
101 --- icu.orig/source/common/unicode/unistr.h     2018-06-21 11:39:21.000000000 +0200
102 +++ icu/source/common/unicode/unistr.h  2018-08-23 19:31:55.790554495 +0200
103 @@ -3026,6 +3026,7 @@ public:
104        UnicodeString(ConstChar16Ptr(text)) {}
105  #endif
106  
107 +#ifdef U_HAS_NULLPTR_T
108    /**
109     * nullptr_t constructor.
110     * Effectively the same as the default constructor, makes an empty string object.
111 @@ -3037,6 +3038,7 @@ public:
112     * @stable ICU 59
113     */
114    UNISTR_FROM_STRING_EXPLICIT inline UnicodeString(const std::nullptr_t text);
115 +#endif
116  
117    /**
118     * char16_t* constructor.
119 @@ -3073,6 +3075,7 @@ public:
120        UnicodeString(ConstChar16Ptr(text), textLength) {}
121  #endif
122  
123 +#ifdef U_HAS_NULLPTR_T
124    /**
125     * nullptr_t constructor.
126     * Effectively the same as the default constructor, makes an empty string object.
127 @@ -3081,6 +3084,7 @@ public:
128     * @stable ICU 59
129     */
130    inline UnicodeString(const std::nullptr_t text, int32_t textLength);
131 +#endif
132  
133    /**
134     * Readonly-aliasing char16_t* constructor.
135 @@ -3155,6 +3159,7 @@ public:
136        UnicodeString(Char16Ptr(buffer), buffLength, buffCapacity) {}
137  #endif
138  
139 +#ifdef U_HAS_NULLPTR_T
140    /**
141     * Writable-aliasing nullptr_t constructor.
142     * Effectively the same as the default constructor, makes an empty string object.
143 @@ -3164,6 +3169,7 @@ public:
144     * @stable ICU 59
145     */
146    inline UnicodeString(std::nullptr_t buffer, int32_t buffLength, int32_t buffCapacity);
147 +#endif
148  
149  #if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION
150  
151 @@ -3875,6 +3881,7 @@ UnicodeString::UnicodeString() {
152    fUnion.fStackFields.fLengthAndFlags=kShortString;
153  }
154  
155 +#ifdef U_HAS_NULLPTR_T
156  inline UnicodeString::UnicodeString(const std::nullptr_t /*text*/) {
157    fUnion.fStackFields.fLengthAndFlags=kShortString;
158  }
159 @@ -3886,6 +3893,7 @@ inline UnicodeString::UnicodeString(cons
160  inline UnicodeString::UnicodeString(std::nullptr_t /*buffer*/, int32_t /*buffLength*/, int32_t /*buffCapacity*/) {
161    fUnion.fStackFields.fLengthAndFlags=kShortString;
162  }
163 +#endif
164  
165  //========================================
166  // Read-only implementation methods
167 @@ -3936,7 +3944,11 @@ UnicodeString::isBufferWritable() const
168  inline const char16_t *
169  UnicodeString::getBuffer() const {
170    if(fUnion.fFields.fLengthAndFlags&(kIsBogus|kOpenGetBuffer)) {
171 +#ifdef U_HAS_NULLPTR_T
172      return nullptr;
173 +#else
174 +    return 0;
175 +#endif
176    } else if(fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) {
177      return fUnion.fStackFields.fBuffer;
178    } else {
This page took 0.113104 seconds and 3 git commands to generate.