Bug 1299615 - Part 1: Update ICU patch files to apply cleanly on ICU58. r=Waldo
deleted file mode 100644
--- a/intl/icu-patches/bug-1172609-icu-fix.diff
+++ /dev/null
@@ -1,81 +0,0 @@
-This patch is taken from the version of ICU in Google's Chromium.
-
-See: https://chromium.googlesource.com/chromium/deps/icu/+/10834e84d250eb31a73496bfdb7923eaa43ead51
-
-diff --git a/intl/icu/source/common/putil.cpp b/intl/icu/source/common/putil.cpp
---- a/intl/icu/source/common/putil.cpp
-+++ b/intl/icu/source/common/putil.cpp
-@@ -965,16 +965,25 @@ static char* searchForTZFile(const char*
- }
- }
- }
- }
- closedir(dirp);
- return result;
- }
- #endif
-+
-+U_CAPI void U_EXPORT2
-+uprv_tzname_clear_cache()
-+{
-+#if defined(CHECK_LOCALTIME_LINK) && !defined(DEBUG_SKIP_LOCALTIME_LINK)
-+ gTimeZoneBufferPtr = NULL;
-+#endif
-+}
-+
- U_CAPI const char* U_EXPORT2
- uprv_tzname(int n)
- {
- const char *tzid = NULL;
- #if U_PLATFORM_USES_ONLY_WIN32_API
- tzid = uprv_detectWindowsTimeZone();
-
- if (tzid != NULL) {
-diff --git a/intl/icu/source/common/putilimp.h b/intl/icu/source/common/putilimp.h
---- a/intl/icu/source/common/putilimp.h
-+++ b/intl/icu/source/common/putilimp.h
-@@ -478,16 +478,22 @@ U_INTERNAL int32_t U_EXPORT2 uprv_timez
- * tzname(1) Three-letter DST zone name derived from TZ environment
- * variable. E.g., "PDT". If DST zone is omitted from TZ,
- * tzname(1) is an empty string.
- * @internal
- */
- U_INTERNAL const char* U_EXPORT2 uprv_tzname(int n);
-
- /**
-+ * Reset the global tzname cache.
-+ * @internal
-+ */
-+U_INTERNAL void uprv_tzname_clear_cache();
-+
-+/**
- * Get UTC (GMT) time measured in milliseconds since 0:00 on 1/1/1970.
- * This function is affected by 'faketime' and should be the bottleneck for all user-visible ICU time functions.
- * @return the UTC time measured in milliseconds
- * @internal
- */
- U_INTERNAL UDate U_EXPORT2 uprv_getUTCtime(void);
-
- /**
-diff --git a/intl/icu/source/i18n/timezone.cpp b/intl/icu/source/i18n/timezone.cpp
---- a/intl/icu/source/i18n/timezone.cpp
-+++ b/intl/icu/source/i18n/timezone.cpp
-@@ -453,16 +453,18 @@ TimeZone::detectHostTimeZone()
- int32_t rawOffset = 0;
- const char *hostID;
-
- // First, try to create a system timezone, based
- // on the string ID in tzname[0].
-
- uprv_tzset(); // Initialize tz... system data
-
-+ uprv_tzname_clear_cache();
-+
- // Get the timezone ID from the host. This function should do
- // any required host-specific remapping; e.g., on Windows this
- // function maps the Date and Time control panel setting to an
- // ICU timezone ID.
- hostID = uprv_tzname(0);
-
- // Invert sign because UNIX semantics are backwards
- rawOffset = uprv_timezone() * -U_MILLIS_PER_SECOND;
--- a/intl/icu-patches/bug-1228227-bug-1263325-libc++-gcc_hidden.diff
+++ b/intl/icu-patches/bug-1228227-bug-1263325-libc++-gcc_hidden.diff
@@ -1,16 +1,16 @@
Limit libstdc++ workaround to not upset libc++ with pragma visibility.
https://ssl.icu-project.org/trac/ticket/12023
diff --git a/intl/icu/source/common/unicode/std_string.h b/intl/icu/source/common/unicode/std_string.h
--- a/intl/icu/source/common/unicode/std_string.h
+++ b/intl/icu/source/common/unicode/std_string.h
-@@ -22,16 +22,16 @@
+@@ -24,16 +24,16 @@
* \brief C++ API: Central ICU header for including the C++ standard <string>
* header and for related definitions.
*/
#include "unicode/utypes.h"
#if U_HAVE_STD_STRING
@@ -21,36 +21,36 @@ diff --git a/intl/icu/source/common/unic
#include <string>
#endif // U_HAVE_STD_STRING
#endif // __STD_STRING_H__
diff --git a/intl/icu/source/common/utypeinfo.h b/intl/icu/source/common/utypeinfo.h
--- a/intl/icu/source/common/utypeinfo.h
+++ b/intl/icu/source/common/utypeinfo.h
-@@ -17,14 +17,14 @@
+@@ -19,14 +19,14 @@
// Whenever 'typeid' is used, this header has to be included
// instead of <typeinfo>.
- // Visual Stuido 10 emits warning 4275 with this change. If you compile
+ // Visual Studio 10 emits warning 4275 with this change. If you compile
// with exception disabled, you have to suppress warning 4275.
#if defined(_MSC_VER) && _HAS_EXCEPTIONS == 0
#include <exception>
using std::exception;
#endif
-#if !defined(_MSC_VER)
+#if defined(__GLIBCXX__)
namespace std { class type_info; } // WORKAROUND: http://llvm.org/bugs/show_bug.cgi?id=13364
#endif
#include <typeinfo> // for 'typeid' to work
#endif
diff --git a/intl/icu/source/io/unicode/ustream.h b/intl/icu/source/io/unicode/ustream.h
--- a/intl/icu/source/io/unicode/ustream.h
+++ b/intl/icu/source/io/unicode/ustream.h
-@@ -23,17 +23,17 @@
+@@ -25,17 +25,17 @@
* \file
* \brief C++ API: Unicode iostream like API
*
* At this time, this API is very limited. It contains
* operator<< and operator>> for UnicodeString manipulation with the
* C++ I/O stream API.
*/
deleted file mode 100644
--- a/intl/icu-patches/icu-release-56-1-flagparser-fix.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/intl/icu/source/tools/pkgdata/pkgdata.cpp b/intl/icu/source/tools/pkgdata/pkgdata.cpp
---- a/intl/icu/source/tools/toolutil/flagparser.c
-+++ b/intl/icu/source/tools/toolutil/flagparser.c
-@@ -96,8 +96,8 @@
- uprv_free(buffer);
-
- T_FileStream_close(f);
--
-- if (U_FAILURE(*status)) {
-+
-+ if (U_FAILURE(*status) && *status != U_BUFFER_OVERFLOW_ERROR) {
- return -1;
- }
-
new file mode 100644
--- /dev/null
+++ b/intl/icu-patches/ucol_getKeywordValuesForLocale-ulist_resetList.diff
@@ -0,0 +1,62 @@
+https://ssl.icu-project.org/trac/ticket/12827
+https://ssl.icu-project.org/trac/changeset/39484 (Excluding test-related bits
+because we remove the "test" directory before applying the ICU patches.)
+
+Index: /intl/icu/source/common/ulist.c
+===================================================================
+--- /intl/icu/source/common/ulist.c (revision 39483)
++++ /intl/icu/source/common/ulist.c (revision 39484)
+@@ -30,5 +30,4 @@
+
+ int32_t size;
+- int32_t currentIndex;
+ };
+
+@@ -52,5 +51,4 @@
+ newList->tail = NULL;
+ newList->size = 0;
+- newList->currentIndex = -1;
+
+ return newList;
+@@ -81,6 +79,7 @@
+ p->next->previous = p->previous;
+ }
+- list->curr = NULL;
+- list->currentIndex = 0;
++ if (p == list->curr) {
++ list->curr = p->next;
++ }
+ --list->size;
+ if (p->forceDelete) {
+@@ -151,5 +150,4 @@
+ list->head->previous = newItem;
+ list->head = newItem;
+- list->currentIndex++;
+ }
+
+@@ -194,5 +192,4 @@
+ curr = list->curr;
+ list->curr = curr->next;
+- list->currentIndex++;
+
+ return curr->data;
+@@ -210,5 +207,4 @@
+ if (list != NULL) {
+ list->curr = list->head;
+- list->currentIndex = 0;
+ }
+ }
+@@ -273,3 +269,2 @@
+ return (UList *)(en->context);
+ }
+-
+Index: /intl/icu/source/i18n/ucol_res.cpp
+===================================================================
+--- /intl/icu/source/i18n/ucol_res.cpp (revision 39483)
++++ /intl/icu/source/i18n/ucol_res.cpp (revision 39484)
+@@ -681,4 +681,5 @@
+ }
+ memcpy(en, &defaultKeywordValues, sizeof(UEnumeration));
++ ulist_resetList(sink.values); // Initialize the iterator.
+ en->context = sink.values;
+ sink.values = NULL; // Avoid deletion in the sink destructor.
--- a/intl/update-icu.sh
+++ b/intl/update-icu.sh
@@ -1,35 +1,37 @@
#!/bin/sh
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
set -e
# Usage: update-icu.sh <URL of ICU SVN with release>
-# E.g., for ICU 55.1: update-icu.sh http://source.icu-project.org/repos/icu/icu/tags/release-55-1/
+# E.g., for ICU 58.1: update-icu.sh https://ssl.icu-project.org/repos/icu/icu/tags/release-58-1/
if [ $# -lt 1 ]; then
echo "Usage: update-icu.sh <URL of ICU SVN with release>"
exit 1
fi
# Ensure that $Date$ in the checked-out svn files expands timezone-agnostically,
# so that this script's behavior is consistent when run from any time zone.
export TZ=UTC
+# Also ensure SVN-INFO isn't localized.
+export LANG=C
+
icu_dir=`dirname $0`/icu
# Remove intl/icu/source, then replace it with a clean export.
rm -rf ${icu_dir}/source
svn export $1/source/ ${icu_dir}/source
-# remove layout, tests, and samples, but leave makefiles in place
-find ${icu_dir}/source/layout -name '*Makefile.in' -prune -or -type f -print | xargs rm
+# remove layoutex, tests, and samples, but leave makefiles in place
find ${icu_dir}/source/layoutex -name '*Makefile.in' -prune -or -type f -print | xargs rm
find ${icu_dir}/source/test -name '*Makefile.in' -prune -or -type f -print | xargs rm
find ${icu_dir}/source/samples -name '*Makefile.in' -prune -or -type f -print | xargs rm
# remove data that we currently don't need
rm -rf ${icu_dir}/source/data/brkitr/*
rm ${icu_dir}/source/data/lang/*.mk
rm ${icu_dir}/source/data/lang/*.txt
@@ -50,21 +52,20 @@ rm ${icu_dir}/source/data/unit/*.txt
# (This ensures that if ICU modifications are performed properly, it's always
# possible to run the command at the top of this script and make no changes to
# the tree.)
svn info $1 | grep -v '^Revision: [[:digit:]]\+$' > ${icu_dir}/SVN-INFO
for patch in \
bug-915735 \
suppress-warnings.diff \
- bug-1172609-icu-fix.diff \
bug-1172609-timezone-recreateDefault.diff \
bug-1198952-workaround-make-3.82-bug.diff \
- icu-release-56-1-flagparser-fix.patch \
bug-1228227-bug-1263325-libc++-gcc_hidden.diff \
+ ucol_getKeywordValuesForLocale-ulist_resetList.diff \
; do
echo "Applying local patch $patch"
patch -d ${icu_dir}/../../ -p1 --no-backup-if-mismatch < ${icu_dir}/../icu-patches/$patch
done
topsrcdir=`dirname $0`/../
python ${topsrcdir}/js/src/tests/ecma_6/String/make-normalize-generateddata-input.py $topsrcdir