[packages/icu] - added cxx-pre11 patch (allow using C++ API in GCC c++98/c++03 mode) - release 2

qboosh qboosh at pld-linux.org
Tue Apr 25 18:06:45 CEST 2017


commit 0e2868a505e6050591a179e66205b588ccd0a065
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Tue Apr 25 18:07:02 2017 +0200

    - added cxx-pre11 patch (allow using C++ API in GCC c++98/c++03 mode)
    - release 2

 icu-cxx-pre11.patch | 174 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 icu.spec            |   4 +-
 2 files changed, 177 insertions(+), 1 deletion(-)
---
diff --git a/icu.spec b/icu.spec
index cf2c487..3076f5a 100644
--- a/icu.spec
+++ b/icu.spec
@@ -7,11 +7,12 @@ Summary:	International Components for Unicode
 Summary(pl.UTF-8):	Międzynarodowe komponenty dla unikodu
 Name:		icu
 Version:	59.1
-Release:	1
+Release:	2
 License:	MIT-like
 Group:		Libraries
 Source0:	http://download.icu-project.org/files/icu4c/%{version}/%{name}4c-%{ver}-src.tgz
 # Source0-md5:	54923fa9fab5b2b83f235fb72523de37
+Patch0:		%{name}-cxx-pre11.patch
 URL:		http://www.icu-project.org/
 BuildRequires:	autoconf >= 2.69
 BuildRequires:	libstdc++-devel
@@ -94,6 +95,7 @@ biblioteki programistyczne ICU.
 
 %prep
 %setup -q -n %{name}
+%patch0 -p1
 
 %build
 cd source
diff --git a/icu-cxx-pre11.patch b/icu-cxx-pre11.patch
new file mode 100644
index 0000000..3a4457a
--- /dev/null
+++ b/icu-cxx-pre11.patch
@@ -0,0 +1,174 @@
+--- icu/source/common/unicode/umachine.h.orig	2017-03-16 20:01:12.000000000 +0100
++++ icu/source/common/unicode/umachine.h	2017-04-24 21:51:37.750924621 +0200
+@@ -295,7 +295,7 @@
+  * 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 <uchar.h>
+ # define U_CHAR16_IS_TYPEDEF 1
+--- icu/source/common/unicode/char16ptr.h.orig	2017-03-29 06:44:37.000000000 +0200
++++ icu/source/common/unicode/char16ptr.h	2017-04-25 17:32:39.386782173 +0200
+@@ -61,12 +61,14 @@
+      */
+     inline Char16Ptr(wchar_t *p);
+ #endif
++#ifdef U_HAS_NULLPTR_T
+     /**
+      * nullptr constructor.
+      * @param p nullptr
+      * @draft ICU 59
+      */
+     inline Char16Ptr(std::nullptr_t p);
++#endif
+     /**
+      * Destructor.
+      * @draft ICU 59
+@@ -114,7 +116,9 @@
+ #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);
+ }
+@@ -130,7 +134,9 @@
+ #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; }
+@@ -168,12 +174,14 @@
+      */
+     inline ConstChar16Ptr(const wchar_t *p);
+ #endif
++#ifdef U_HAS_NULLPTR_T
+     /**
+      * nullptr constructor.
+      * @param p nullptr
+      * @draft ICU 59
+      */
+     inline ConstChar16Ptr(const std::nullptr_t p);
++#endif
+ 
+     /**
+      * Destructor.
+@@ -222,7 +230,9 @@
+ #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);
+ }
+@@ -238,7 +248,9 @@
+ #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; }
+--- icu/source/common/unicode/platform.h.orig	2017-03-22 20:06:26.000000000 +0100
++++ icu/source/common/unicode/platform.h	2017-04-25 17:30:01.483450642 +0200
+@@ -503,6 +503,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
+ 
+ /**
+--- icu/source/common/unicode/unistr.h.orig	2017-03-29 06:44:37.000000000 +0200
++++ icu/source/common/unicode/unistr.h	2017-04-25 17:33:43.030114781 +0200
+@@ -3049,6 +3049,7 @@
+    * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor,
+    * it should always be available regardless of U_HIDE_DRAFT_API status
+    */
++#ifdef U_HAS_NULLPTR_T
+   /**
+    * nullptr_t constructor.
+    * Effectively the same as the default constructor, makes an empty string object.
+@@ -3060,6 +3061,7 @@
+    * @draft ICU 59
+    */
+   UNISTR_FROM_STRING_EXPLICIT inline UnicodeString(const std::nullptr_t text);
++#endif
+ 
+   /**
+    * char16_t* constructor.
+@@ -3108,6 +3110,7 @@
+    * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor,
+    * it should always be available regardless of U_HIDE_DRAFT_API status
+    */
++#ifdef U_HAS_NULLPTR_T
+   /**
+    * nullptr_t constructor.
+    * Effectively the same as the default constructor, makes an empty string object.
+@@ -3116,6 +3119,7 @@
+    * @draft ICU 59
+    */
+   inline UnicodeString(const std::nullptr_t text, int32_t length);
++#endif
+ 
+   /**
+    * Readonly-aliasing char16_t* constructor.
+@@ -3202,6 +3206,7 @@
+    * Do not use #ifndef U_HIDE_DRAFT_API for the following constructor,
+    * it should always be available regardless of U_HIDE_DRAFT_API status
+    */
++#ifdef U_HAS_NULLPTR_T
+   /**
+    * Writable-aliasing nullptr_t constructor.
+    * Effectively the same as the default constructor, makes an empty string object.
+@@ -3211,6 +3216,7 @@
+    * @draft ICU 59
+    */
+   inline UnicodeString(std::nullptr_t buffer, int32_t buffLength, int32_t buffCapacity);
++#endif
+ 
+ #if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION
+ 
+@@ -3924,6 +3930,7 @@
+   fUnion.fStackFields.fLengthAndFlags=kShortString;
+ }
+ 
++#ifdef U_HAS_NULLPTR_T
+ inline UnicodeString::UnicodeString(const std::nullptr_t /*text*/) {
+   fUnion.fStackFields.fLengthAndFlags=kShortString;
+ }
+@@ -3935,6 +3942,7 @@
+ inline UnicodeString::UnicodeString(std::nullptr_t /*buffer*/, int32_t /*buffLength*/, int32_t /*buffCapacity*/) {
+   fUnion.fStackFields.fLengthAndFlags=kShortString;
+ }
++#endif
+ 
+ //========================================
+ // Read-only implementation methods
+@@ -3985,7 +3993,11 @@
+ 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 {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/icu.git/commitdiff/0e2868a505e6050591a179e66205b588ccd0a065



More information about the pld-cvs-commit mailing list