From db02e51a31ae394ff15eaa0e582c8755adff89f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Wed, 1 Nov 2017 11:48:48 -0700 Subject: [PATCH] Bug 1405993 - Part 2: Remove no longer used ICU patches. r=Waldo --HG-- extra : rebase_source : ef32ed7d42c283997ae0dac0db274f35fb5431f5 --- ...nvertToPosix-stack-value-out-of-scope.diff | 34 ---------- intl/icu-patches/bug-1380083 | 34 ---------- .../bug-1387476-timezone-detection.diff | 67 ------------------- intl/icu-patches/bug-1387937.diff | 23 ------- ...tions-callconvention-anachronism-msvc.diff | 33 --------- intl/update-icu.sh | 5 -- 6 files changed, 196 deletions(-) delete mode 100644 intl/icu-patches/bug-1373763-convertToPosix-stack-value-out-of-scope.diff delete mode 100644 intl/icu-patches/bug-1380083 delete mode 100644 intl/icu-patches/bug-1387476-timezone-detection.diff delete mode 100644 intl/icu-patches/bug-1387937.diff delete mode 100644 intl/icu-patches/u_setMemoryFunctions-callconvention-anachronism-msvc.diff diff --git a/intl/icu-patches/bug-1373763-convertToPosix-stack-value-out-of-scope.diff b/intl/icu-patches/bug-1373763-convertToPosix-stack-value-out-of-scope.diff deleted file mode 100644 index f04596a59e03..000000000000 --- a/intl/icu-patches/bug-1373763-convertToPosix-stack-value-out-of-scope.diff +++ /dev/null @@ -1,34 +0,0 @@ -Move the stack allocated buffer to the top-level, so its value can be accessed after the if-statement. - -https://ssl.icu-project.org/trac/ticket/13263 - -diff --git a/intl/icu/source/common/locmap.cpp b/intl/icu/source/common/locmap.cpp ---- a/intl/icu/source/common/locmap.cpp -+++ b/intl/icu/source/common/locmap.cpp -@@ -1028,24 +1028,25 @@ U_CAPI int32_t - uprv_convertToPosix(uint32_t hostid, char *posixID, int32_t posixIDCapacity, UErrorCode* status) - { - uint16_t langID; - uint32_t localeIndex; - UBool bLookup = TRUE; - const char *pPosixID = NULL; - - #ifdef USE_WINDOWS_LCID_MAPPING_API -+ char locName[LOCALE_NAME_MAX_LENGTH] = {}; // ICU name can't be longer than Windows name -+ - // Note: Windows primary lang ID 0x92 in LCID is used for Central Kurdish and - // GetLocaleInfo() maps such LCID to "ku". However, CLDR uses "ku" for - // Northern Kurdish and "ckb" for Central Kurdish. For this reason, we cannot - // use the Windows API to resolve locale ID for this specific case. - if ((hostid & 0x3FF) != 0x92) { - int32_t tmpLen = 0; - UChar windowsLocaleName[LOCALE_NAME_MAX_LENGTH]; // ULOC_FULLNAME_CAPACITY > LOCALE_NAME_MAX_LENGTH -- char locName[LOCALE_NAME_MAX_LENGTH]; // ICU name can't be longer than Windows name - - // Note: LOCALE_ALLOW_NEUTRAL_NAMES was enabled in Windows7+, prior versions did not handle neutral (no-region) locale names. - tmpLen = LCIDToLocaleName(hostid, (PWSTR)windowsLocaleName, UPRV_LENGTHOF(windowsLocaleName), LOCALE_ALLOW_NEUTRAL_NAMES); - if (tmpLen > 1) { - int32_t i = 0; - // Only need to look up in table if have _, eg for de-de_phoneb type alternate sort. - bLookup = FALSE; - for (i = 0; i < UPRV_LENGTHOF(locName); i++) diff --git a/intl/icu-patches/bug-1380083 b/intl/icu-patches/bug-1380083 deleted file mode 100644 index fc6471648153..000000000000 --- a/intl/icu-patches/bug-1380083 +++ /dev/null @@ -1,34 +0,0 @@ -Bug 1380083 Change backslaches to forward slashes. Upstream: http://bugs.icu-project.org/trac/changeset/40102 - -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 -@@ -96,25 +96,25 @@ - # define WIN32_LEAN_AND_MEAN - #endif - # define VC_EXTRALEAN - # define NOUSER - # define NOSERVICE - # define NOIME - # define NOMCX - # include --# include "unicode\uloc.h" -+# include "unicode/uloc.h" - #if U_PLATFORM_HAS_WINUWP_API == 0 - # include "wintz.h" - #else // U_PLATFORM_HAS_WINUWP_API - typedef PVOID LPMSG; // TODO: figure out how to get rid of this typedef - #include - #include --#include --#include -+#include -+#include - - using namespace ABI::Windows::Foundation; - using namespace Microsoft::WRL; - using namespace Microsoft::WRL::Wrappers; - #endif - #elif U_PLATFORM == U_PF_OS400 - # include - # include /* error code structure */ \ No newline at end of file diff --git a/intl/icu-patches/bug-1387476-timezone-detection.diff b/intl/icu-patches/bug-1387476-timezone-detection.diff deleted file mode 100644 index 3ddc7dc5ea06..000000000000 --- a/intl/icu-patches/bug-1387476-timezone-detection.diff +++ /dev/null @@ -1,67 +0,0 @@ -Update time detection for newer Linux distros and macOS 10.13 - -https://ssl.icu-project.org/trac/ticket/12770 -https://ssl.icu-project.org/trac/changeset/40427 -https://ssl.icu-project.org/trac/changeset/40432 -https://ssl.icu-project.org/trac/changeset?old=40300&old_path=trunk%2Ficu4c%2Fsource%2Fcommon%2Fputil.cpp&new_path=trunk%2Ficu4c%2Fsource%2Fcommon%2Fputil.cpp&new=40432 - -Index: /intl/icu/source/common/putil.cpp -=================================================================== ---- /intl/icu/source/common/putil.cpp (revision 40300) -+++ /intl/icu/source/common/putil.cpp (revision 40432) -@@ -676,4 +676,14 @@ - #if !UCONFIG_NO_FILE_IO && ((U_PLATFORM_IS_DARWIN_BASED && (U_PLATFORM != U_PF_IPHONE || defined(U_TIMEZONE))) || U_PLATFORM_IS_LINUX_BASED || U_PLATFORM == U_PF_BSD || U_PLATFORM == U_PF_SOLARIS) - /* These platforms are likely to use Olson timezone IDs. */ -+/* common targets of the symbolic link at TZDEFAULT are: -+ * "/usr/share/zoneinfo/" default, older Linus distros, macOS to 10.12 -+ * "../usr/share/zoneinfo/" newer Linux distros: Red Hat Enterprise Linux 7, Ubuntu, SuSe Linux -+ * "/usr/share/lib/zoneinfo/" Solaris -+ * "../usr/share/lib/zoneinfo/" Solaris -+ * "/var/db/timezone/zoneinfo/" macOS 10.13 -+ * To avoid checking lots of paths, just check that the target path -+ * before the ends with "/zoneinfo/", and the is valid. -+ */ -+ - #define CHECK_LOCALTIME_LINK 1 - #if U_PLATFORM_IS_DARWIN_BASED -@@ -683,5 +693,4 @@ - #define TZDEFAULT "/etc/localtime" - #define TZZONEINFO "/usr/share/lib/zoneinfo/" --#define TZZONEINFO2 "../usr/share/lib/zoneinfo/" - #define TZ_ENV_CHECK "localtime" - #else -@@ -689,4 +698,5 @@ - #define TZZONEINFO "/usr/share/zoneinfo/" - #endif -+#define TZZONEINFOTAIL "/zoneinfo/" - #if U_HAVE_DIRENT_H - #define TZFILE_SKIP "posixrules" /* tz file to skip when searching. */ -@@ -1132,22 +1142,13 @@ - int32_t ret = (int32_t)readlink(TZDEFAULT, gTimeZoneBuffer, sizeof(gTimeZoneBuffer)-1); - if (0 < ret) { -- int32_t tzZoneInfoLen = uprv_strlen(TZZONEINFO); -+ int32_t tzZoneInfoTailLen = uprv_strlen(TZZONEINFOTAIL); - gTimeZoneBuffer[ret] = 0; -- if (uprv_strncmp(gTimeZoneBuffer, TZZONEINFO, tzZoneInfoLen) == 0 -- && isValidOlsonID(gTimeZoneBuffer + tzZoneInfoLen)) -+ char * tzZoneInfoTailPtr = uprv_strstr(gTimeZoneBuffer, TZZONEINFOTAIL); -+ -+ if (tzZoneInfoTailPtr != NULL -+ && isValidOlsonID(tzZoneInfoTailPtr + tzZoneInfoTailLen)) - { -- return (gTimeZoneBufferPtr = gTimeZoneBuffer + tzZoneInfoLen); -+ return (gTimeZoneBufferPtr = tzZoneInfoTailPtr + tzZoneInfoTailLen); - } --#if U_PLATFORM == U_PF_SOLARIS -- else -- { -- tzZoneInfoLen = uprv_strlen(TZZONEINFO2); -- if (uprv_strncmp(gTimeZoneBuffer, TZZONEINFO2, tzZoneInfoLen) == 0 -- && isValidOlsonID(gTimeZoneBuffer + tzZoneInfoLen)) -- { -- return (gTimeZoneBufferPtr = gTimeZoneBuffer + tzZoneInfoLen); -- } -- } --#endif - } else { - #if defined(SEARCH_TZFILE) diff --git a/intl/icu-patches/bug-1387937.diff b/intl/icu-patches/bug-1387937.diff deleted file mode 100644 index 43a934ef4a6e..000000000000 --- a/intl/icu-patches/bug-1387937.diff +++ /dev/null @@ -1,23 +0,0 @@ -Bug 1387937 - Import changeset 40324. - -diff --git a/intl/icu/source/i18n/zonemeta.cpp b/intl/icu/source/i18n/zonemeta.cpp ---- a/intl/icu/source/i18n/zonemeta.cpp -+++ b/intl/icu/source/i18n/zonemeta.cpp -@@ -685,17 +685,16 @@ ZoneMeta::createMetazoneMappings(const U - entry->mzid = mz_name; - entry->from = from; - entry->to = to; - - if (mzMappings == NULL) { - mzMappings = new UVector(deleteOlsonToMetaMappingEntry, NULL, status); - if (U_FAILURE(status)) { - delete mzMappings; -- deleteOlsonToMetaMappingEntry(entry); - uprv_free(entry); - break; - } - } - - mzMappings->addElement(entry, status); - if (U_FAILURE(status)) { - break; diff --git a/intl/icu-patches/u_setMemoryFunctions-callconvention-anachronism-msvc.diff b/intl/icu-patches/u_setMemoryFunctions-callconvention-anachronism-msvc.diff deleted file mode 100644 index 803c6d7bc0b9..000000000000 --- a/intl/icu-patches/u_setMemoryFunctions-callconvention-anachronism-msvc.diff +++ /dev/null @@ -1,33 +0,0 @@ -Don't annotate function parameters with call-convention modifier to work around a MSVC compiler warning. - -https://ssl.icu-project.org/trac/ticket/13030 - -diff --git a/intl/icu/source/common/unicode/uclean.h b/intl/icu/source/common/unicode/uclean.h ---- a/intl/icu/source/common/unicode/uclean.h -+++ b/intl/icu/source/common/unicode/uclean.h -@@ -143,19 +143,25 @@ typedef void U_CALLCONV UMemFreeFn (con - * are called. - * @param a Pointer to a user-supplied malloc function. - * @param r Pointer to a user-supplied realloc function. - * @param f Pointer to a user-supplied free function. - * @param status Receives error values. - * @stable ICU 2.8 - * @system - */ -+#ifndef _MSC_VER - U_STABLE void U_EXPORT2 - u_setMemoryFunctions(const void *context, UMemAllocFn * U_CALLCONV a, UMemReallocFn * U_CALLCONV r, UMemFreeFn * U_CALLCONV f, - UErrorCode *status); -+#else -+U_STABLE void U_EXPORT2 -+u_setMemoryFunctions(const void *context, UMemAllocFn * a, UMemReallocFn * r, UMemFreeFn * f, -+ UErrorCode *status); -+#endif - - U_CDECL_END - - #ifndef U_HIDE_DEPRECATED_API - /********************************************************************************* - * - * Deprecated Functions - * diff --git a/intl/update-icu.sh b/intl/update-icu.sh index 3cab2d414cb2..e88fe8613913 100755 --- a/intl/update-icu.sh +++ b/intl/update-icu.sh @@ -70,11 +70,6 @@ for patch in \ suppress-warnings.diff \ bug-1172609-timezone-recreateDefault.diff \ bug-1198952-workaround-make-3.82-bug.diff \ - u_setMemoryFunctions-callconvention-anachronism-msvc.diff \ - bug-1373763-convertToPosix-stack-value-out-of-scope.diff \ - bug-1380083 \ - bug-1387937.diff \ - bug-1387476-timezone-detection.diff \ ; do echo "Applying local patch $patch" patch -d ${icu_dir}/../../ -p1 --no-backup-if-mismatch < ${icu_dir}/../icu-patches/$patch