ICU53: fix deadlock and gcc2 issues.

This commit is contained in:
Adrien Destugues
2014-10-06 12:20:52 +02:00
parent 9c94427e00
commit 3cb5c3c0eb
2 changed files with 229 additions and 43 deletions

View File

@@ -4,7 +4,7 @@ LICENSE="ICU"
COPYRIGHT="1997-2014 IBM Corporation and others."
SRC_URI="http://download.icu-project.org/files/icu4c/$portVersion/icu4c-53_1-src.tgz"
CHECKSUM_SHA256="6fa74fb5aac070c23eaba1711a7178fe582c59867484c5ec07c49002787a9a28"
REVISION="2"
REVISION="3"
ARCHITECTURES="x86_gcc2 x86 x86_64 arm"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
@@ -32,6 +32,7 @@ BUILD_REQUIRES="
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
cmd:autoconf
cmd:awk
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
@@ -45,6 +46,7 @@ PATCHES="icu-53.1.patchset"
BUILD()
{
cd source
autoconf
runConfigure ./configure \
--disable-renaming --disable-samples --disable-extras
make $jobArgs

View File

@@ -1,4 +1,4 @@
From 29c13b672cf527310dbee569b1a854422e8e6d6e Mon Sep 17 00:00:00 2001
From 2f8bd964d8cb7ecedd52c3b9ff90ea5f922d7573 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Mon, 29 Sep 2014 11:19:28 +0200
Subject: gcc2 fixes.
@@ -382,10 +382,10 @@ index baf3254..838ea82 100644
// Bitwise comparison for the collation keys.
diff --git a/source/i18n/unicode/choicfmt.h b/source/i18n/unicode/choicfmt.h
index cfd5206..f9635f4 100644
index cfd5206..d2b7f66 100644
--- a/source/i18n/unicode/choicfmt.h
+++ b/source/i18n/unicode/choicfmt.h
@@ -355,7 +355,14 @@ public:
@@ -355,7 +355,22 @@ public:
virtual const UnicodeString* getFormats(int32_t& count) const;
@@ -394,45 +394,65 @@ index cfd5206..f9635f4 100644
+ icu::UnicodeString& appendTo) const {
+ return NumberFormat::format(number, appendTo);
+ }
+ UnicodeString& format(const Formattable& f, UnicodeString& s,
+ FieldPosition& p, UErrorCode& e) const {
+ return NumberFormat::format(f, s, p, e);
+ }
+ UnicodeString& format(const Formattable& f, UnicodeString& s,
+ UErrorCode& e) const {
+ return NumberFormat::format(f, s, e);
+ }
+#else
using NumberFormat::format;
+#endif
/**
* Formats a double number using this object's choices.
@@ -421,7 +428,9 @@ public:
@@ -421,7 +436,13 @@ public:
FieldPosition& pos,
UErrorCode& success) const;
+#if __GNUC__ != 2
+#if __GNUC__ == 2
+ void parse(UnicodeString& s, Formattable& f, UErrorCode& e) const {
+ NumberFormat::parse(s, f, e);
+ }
+#else
using NumberFormat::parse;
+#endif
/**
* Looks for the longest match of any message string on the input text and,
diff --git a/source/i18n/unicode/compactdecimalformat.h b/source/i18n/unicode/compactdecimalformat.h
index bd8fdba..948b1a9 100644
index bd8fdba..be2e580 100644
--- a/source/i18n/unicode/compactdecimalformat.h
+++ b/source/i18n/unicode/compactdecimalformat.h
@@ -104,7 +104,9 @@ public:
@@ -104,7 +104,13 @@ public:
virtual UBool operator==(const Format& other) const;
+#if __GNUC__ != 2
+#if __GNUC__ == 2
+ UnicodeString& format(double n, UnicodeString& s) const {
+ return DecimalFormat::format(n, s);
+ }
+#else
using DecimalFormat::format;
+#endif
/**
* Format a double or long number using base-10 representation.
diff --git a/source/i18n/unicode/datefmt.h b/source/i18n/unicode/datefmt.h
index ce967a5..268ec29 100644
index ce967a5..59d735d 100644
--- a/source/i18n/unicode/datefmt.h
+++ b/source/i18n/unicode/datefmt.h
@@ -221,7 +221,9 @@ public:
@@ -221,7 +221,13 @@ public:
virtual UBool operator==(const Format&) const;
+#if __GNUC__ != 2
+#if __GNUC__ == 2
+ UnicodeString& format(const Formattable& f, UnicodeString& s, UErrorCode& e) const {
+ return Format::format(f, s, e);
+ }
+#else
using Format::format;
+#endif
@@ -509,18 +529,28 @@ index fb27eec..07ae7cd 100644
/**
* Format an object to produce a string. This method handles Formattable
diff --git a/source/i18n/unicode/measfmt.h b/source/i18n/unicode/measfmt.h
index 2a93b6e..a252dad 100644
index 2a93b6e..c4fd947 100644
--- a/source/i18n/unicode/measfmt.h
+++ b/source/i18n/unicode/measfmt.h
@@ -91,8 +91,15 @@ class DateFormat;
@@ -91,8 +91,25 @@ class DateFormat;
*/
class U_I18N_API MeasureFormat : public Format {
public:
+#if __GNUC__ == 2
+ void parseObject (const UnicodeString& s, Formattable& f, UErrorCode& e)
+ const {
+ Format::parseObject(s, f, e);
+ }
+
+ UnicodeString& format(const Formattable& f, UnicodeString& s,
+ FieldPositionIterator* i, UErrorCode& e) const {
+ return Format::format(f, s, i, e);
+ }
+
+ UnicodeString& format(const Formattable& f, UnicodeString& s,
+ UErrorCode& e) const {
+ return Format::format(f, s, e);
+ }
+#else
using Format::parseObject;
using Format::format;
@@ -529,10 +559,10 @@ index 2a93b6e..a252dad 100644
#ifndef U_HIDE_DRAFT_API
/**
diff --git a/source/i18n/unicode/msgfmt.h b/source/i18n/unicode/msgfmt.h
index 5de91e4..6f625f4 100644
index 5de91e4..8f9f995 100644
--- a/source/i18n/unicode/msgfmt.h
+++ b/source/i18n/unicode/msgfmt.h
@@ -622,7 +622,14 @@ public:
@@ -622,7 +622,17 @@ public:
virtual const Format** getFormats(int32_t& count) const;
@@ -541,13 +571,16 @@ index 5de91e4..6f625f4 100644
+ FieldPositionIterator* i, UErrorCode& e) const {
+ return Format::format(f, s, i, e);
+ }
+ UnicodeString& format(const Formattable& f, UnicodeString& s, UErrorCode& e) {
+ return Format::format(f, s, e);
+ }
+#else
using Format::format;
+#endif
/**
* Formats the given array of arguments into a user-readable string.
@@ -884,6 +891,9 @@ private:
@@ -884,6 +894,9 @@ private:
PluralRules* rules;
UPluralType type;
};
@@ -578,7 +611,7 @@ index c252af0..fdbab5a 100644
/**
* Format an object to produce a string. This method handles
diff --git a/source/i18n/unicode/plurfmt.h b/source/i18n/unicode/plurfmt.h
index bc5aff0..217573d 100644
index bc5aff0..f113c51 100644
--- a/source/i18n/unicode/plurfmt.h
+++ b/source/i18n/unicode/plurfmt.h
@@ -312,7 +312,14 @@ public:
@@ -586,7 +619,7 @@ index bc5aff0..217573d 100644
+#if __GNUC__ == 2
+ UnicodeString format(const Formattable& f, UnicodeString& s,
+ UnicodeString& format(const Formattable& f, UnicodeString& s,
+ FieldPositionIterator* i, UErrorCode& e) const {
+ return Format::format(f, s, i, e);
+ }
@@ -597,24 +630,42 @@ index bc5aff0..217573d 100644
/**
* Formats a plural message for a given number.
diff --git a/source/i18n/unicode/rbnf.h b/source/i18n/unicode/rbnf.h
index 5e4f3b3..5a7c89a 100644
index 5e4f3b3..cedf2bc 100644
--- a/source/i18n/unicode/rbnf.h
+++ b/source/i18n/unicode/rbnf.h
@@ -719,7 +719,9 @@ public:
@@ -719,7 +719,23 @@ public:
const Locale& locale = Locale::getDefault());
+#if __GNUC__ != 2
+#if __GNUC__ == 2
+ UnicodeString& format(const Formattable& f, UnicodeString& s, UErrorCode& e)
+ const {
+ return NumberFormat::format(f, s, e);
+ }
+
+ UnicodeString& format(double n, UnicodeString& s) const {
+ return NumberFormat::format(n, s);
+ }
+
+ UnicodeString& format(int64_t n, UnicodeString& s, FieldPosition& p,
+ UErrorCode& e) const {
+ return NumberFormat::format(n, s, p, e);
+ }
+#else
using NumberFormat::format;
+#endif
/**
* Formats the specified 32-bit number using the default ruleset.
@@ -805,7 +807,9 @@ public:
@@ -805,7 +821,13 @@ public:
FieldPosition& pos,
UErrorCode& status) const;
+#if __GNUC__ != 2
+#if __GNUC__ == 2
+ void parse(const UnicodeString& s, Formattable& f, UErrorCode& e) const {
+ return NumberFormat::parse(s, f, e);
+ }
+#else
using NumberFormat::parse;
+#endif
@@ -635,10 +686,10 @@ index 635144b..fbc89f6 100755
/**
* Selects the phrase for the given keyword
diff --git a/source/i18n/unicode/smpdtfmt.h b/source/i18n/unicode/smpdtfmt.h
index 1e54dc3..12e4775 100644
index 1e54dc3..474abc0 100644
--- a/source/i18n/unicode/smpdtfmt.h
+++ b/source/i18n/unicode/smpdtfmt.h
@@ -860,7 +860,18 @@ public:
@@ -860,7 +860,27 @@ public:
virtual UBool operator==(const Format& other) const;
@@ -651,13 +702,22 @@ index 1e54dc3..12e4775 100644
+ UErrorCode& e) const {
+ return DateFormat::format(f, s, p, e);
+ }
+ UnicodeString& format(const Formattable& f, UnicodeString& s, UErrorCode& e) const {
+ return Format::format(f, s, e);
+ }
+ UnicodeString& format(const UDate& d, UnicodeString& s, FieldPosition& f) const {
+ return DateFormat::format(d, s, f);
+ }
+ UnicodeString& format(const UDate& d, UnicodeString& s) const {
+ return DateFormat::format(d, s);
+ }
+#else
using DateFormat::format;
+#endif
/**
* Format a date or time, which is the standard millis since 24:00 GMT, Jan
@@ -905,7 +916,13 @@ public:
@@ -905,7 +925,16 @@ public:
FieldPositionIterator* posIter,
UErrorCode& status) const;
@@ -665,6 +725,9 @@ index 1e54dc3..12e4775 100644
+ UDate parse(const UnicodeString& s, UErrorCode& e) const {
+ return DateFormat::parse(s, e);
+ }
+ UDate parse (const UnicodeString& s, ParsePosition& p) const {
+ return DateFormat::parse(s, p);
+ }
+#else
using DateFormat::parse;
+#endif
@@ -733,6 +796,46 @@ index f7eb79b..8ea8700 100644
const T *getAlias(le_uint32 i, LEErrorCode &success) const {
return ((const T*)(((const char*)getAlias())+getOffsetFor(i, success)));
diff --git a/source/test/intltest/apicoll.cpp b/source/test/intltest/apicoll.cpp
index 716fbd9..3879a0c 100644
--- a/source/test/intltest/apicoll.cpp
+++ b/source/test/intltest/apicoll.cpp
@@ -1977,7 +1977,22 @@ class TestCollator : public Collator
public:
virtual Collator* clone(void) const;
+#if __GNUC__ == 2
+ EComparisonResult compare (const UnicodeString& s1, const UnicodeString& s2)
+ const {
+ return Collator::compare(s1, s2);
+ }
+ EComparisonResult compare (const UnicodeString& s1, const UnicodeString& s2,
+ int32_t i) const {
+ return Collator::compare(s1, s2, i);
+ }
+ EComparisonResult compare (const UChar* s1, int32_t l1, const UChar* s2,
+ int32_t l2) const {
+ return Collator::compare(s1, l1, s2, l2);
+ }
+#else
using Collator::compare;
+#endif
virtual UCollationResult compare(const UnicodeString& source,
const UnicodeString& target,
diff --git a/source/test/iotest/stream.cpp b/source/test/iotest/stream.cpp
index a821636..083b4ab 100644
--- a/source/test/iotest/stream.cpp
+++ b/source/test/iotest/stream.cpp
@@ -131,7 +131,7 @@ static void U_CALLCONV TestStream(void)
#endif
UnicodeString ustr("string");
- outFormatStream << "1234567890" << setw(10) << left << ustr << " " << "0123456789";
+ outFormatStream << "1234567890" << setw(10) << ios::left << ustr << " " << "0123456789";
#ifdef USE_SSTREAM
tempStr = outFormatStream.str();
diff --git a/source/tools/toolutil/udbgutil.cpp b/source/tools/toolutil/udbgutil.cpp
index efad363..5676e6d 100644
--- a/source/tools/toolutil/udbgutil.cpp
@@ -751,7 +854,7 @@ index efad363..5676e6d 100644
1.8.3.4
From 0bf0ba149f98e3b58fcfefde02fb7b94fa17e776 Mon Sep 17 00:00:00 2001
From 38f27f32552e50fef69be35a5310bb0e7f39df46 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Thu, 2 Oct 2014 14:54:39 +0200
Subject: Force definition of U_DISABLE_RENAMING
@@ -777,25 +880,106 @@ index c22c211..57b8347 100644
1.8.3.4
From 052c371ec0f683722a2d2be8fd5d0af70b57446a Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Thu, 2 Oct 2014 15:23:39 +0200
Subject: Fix bad prototype.
From f4f4e5f0cc785ca73cd1d40d5faf52e60850139c Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Fri, 3 Oct 2014 11:07:01 +0200
Subject: Don't call tzset and tzname on Haiku
While they exist, they are implemented using ICU, and trying to use them
within ICU results in a deadlock.
diff --git a/source/i18n/unicode/plurfmt.h b/source/i18n/unicode/plurfmt.h
index 217573d..f113c51 100644
--- a/source/i18n/unicode/plurfmt.h
+++ b/source/i18n/unicode/plurfmt.h
@@ -313,7 +313,7 @@ public:
diff --git a/source/common/putilimp.h b/source/common/putilimp.h
index beaf647..37e3e62 100644
--- a/source/common/putilimp.h
+++ b/source/common/putilimp.h
@@ -105,7 +105,7 @@ typedef size_t uintptr_t;
/* Use the predefined value. */
#elif U_PLATFORM_USES_ONLY_WIN32_API
# define U_TZSET _tzset
-#elif U_PLATFORM == U_PF_OS400
+#elif U_PLATFORM == U_PF_OS400 || defined(__HAIKU__)
/* not defined */
#else
# define U_TZSET tzset
@@ -136,7 +136,7 @@ typedef size_t uintptr_t;
/* Use the predefined value. */
#elif U_PLATFORM_USES_ONLY_WIN32_API
# define U_TZNAME _tzname
-#elif U_PLATFORM == U_PF_OS400
+#elif U_PLATFORM == U_PF_OS400 || defined(__HAIKU__)
/* not defined */
#else
# define U_TZNAME tzname
diff --git a/source/configure.ac b/source/configure.ac
index d52b1e6..a772836 100644
--- a/source/configure.ac
+++ b/source/configure.ac
@@ -788,50 +788,26 @@ else
fi
AC_SUBST(U_HAVE_POPEN)
-AC_CHECK_FUNC(tzset)
+#AC_CHECK_FUNC(tzset)
U_HAVE_TZSET=0
-if test x$ac_cv_func_tzset = xyes
-then
- U_TZSET=tzset
- U_HAVE_TZSET=1
-else
- AC_CHECK_FUNC(_tzset)
- if test x$ac_cv_func__tzset = xyes
- then
- U_TZSET=_tzset
- U_HAVE_TZSET=1
- else
- CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZSET=0"
- fi
-fi
+#if test x$ac_cv_func_tzset = xyes
+#then
+# U_TZSET=tzset
+# U_HAVE_TZSET=1
+#else
+# AC_CHECK_FUNC(_tzset)
+# if test x$ac_cv_func__tzset = xyes
+# then
+# U_TZSET=_tzset
+# U_HAVE_TZSET=1
+# else
+# CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZSET=0"
+# fi
+#fi
AC_SUBST(U_HAVE_TZSET)
AC_SUBST(U_TZSET)
U_HAVE_TZNAME=0
-AC_CACHE_CHECK(for tzname,ac_cv_var_tzname,
-[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifndef __USE_POSIX
-#define __USE_POSIX
-#endif
-#include <stdlib.h>
-#include <time.h>
-#ifndef tzname /* For SGI. */
-extern char *tzname[]; /* RS6000 and others reject char **tzname. */
-#endif]], [atoi(*tzname);])],[ac_cv_var_tzname=yes],[ac_cv_var_tzname=no])])
-if test $ac_cv_var_tzname = yes; then
- U_TZNAME=tzname
- U_HAVE_TZNAME=1
-else
- AC_CACHE_CHECK(for _tzname,ac_cv_var__tzname,
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
- #include <time.h>
- extern char *_tzname[];]], [atoi(*_tzname);])],[ac_cv_var__tzname=yes],[ac_cv_var__tzname=no])])
- if test $ac_cv_var__tzname = yes; then
- U_TZNAME=_tzname
- U_HAVE_TZNAME=1
- else
- CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZNAME=0"
- fi
-fi
AC_SUBST(U_HAVE_TZNAME)
AC_SUBST(U_TZNAME)
#if __GNUC__ == 2
- UnicodeString format(const Formattable& f, UnicodeString& s,
+ UnicodeString& format(const Formattable& f, UnicodeString& s,
FieldPositionIterator* i, UErrorCode& e) const {
return Format::format(f, s, i, e);
}
--
1.8.3.4