commit af6559113407f1909485985b900dc2184221f0f6
parent 891ab80a21c4620e6b140c92fc715f9988c82db7
Author: André Bargull <andre.bargull@gmail.com>
Date: Tue, 25 Nov 2025 15:19:26 +0000
Bug 2000225 - Part 2: Update ICU patch files. r=platform-i18n-reviewers,jfkthame
Update patch files to apply cleanly on ICU 78.
Differential Revision: https://phabricator.services.mozilla.com/D273809
Diffstat:
4 files changed, 138 insertions(+), 92 deletions(-)
diff --git a/intl/icu-patches/bug-1614941-dsb-hsb-dates.diff b/intl/icu-patches/bug-1614941-dsb-hsb-dates.diff
@@ -1,7 +1,10 @@
diff --git a/intl/icu/source/data/locales/dsb.txt b/intl/icu/source/data/locales/dsb.txt
--- a/intl/icu/source/data/locales/dsb.txt
+++ b/intl/icu/source/data/locales/dsb.txt
-@@ -480,21 +480,25 @@ dsb{
+@@ -499,28 +499,32 @@ dsb{
+ MMMMW{
+ few{"W. 'tyźeń' MMMM"}
+ one{"W. 'tyźeń' MMMM"}
other{"W. 'tyźeń' MMMM"}
two{"W. 'tyźeń' MMMM"}
}
@@ -14,6 +17,7 @@ diff --git a/intl/icu/source/data/locales/dsb.txt b/intl/icu/source/data/locales
h{"h a"}
hm{"h:mm a"}
hms{"h:mm:ss a"}
+ hv{"'zeg'. h a v"}
yM{"M.y"}
yMEd{"E, d.M.y"}
+ yMM{"MM y"}
@@ -27,10 +31,16 @@ diff --git a/intl/icu/source/data/locales/dsb.txt b/intl/icu/source/data/locales
yQQQQ{"QQQQ y"}
yw{
few{"w. 'tyźeń' 'lěta' Y"}
+ one{"w. 'tyźeń' 'lěta' Y"}
+ other{"w. 'tyźeń' 'lěta' Y"}
+ two{"w. 'tyźeń' 'lěta' Y"}
diff --git a/intl/icu/source/data/locales/hsb.txt b/intl/icu/source/data/locales/hsb.txt
--- a/intl/icu/source/data/locales/hsb.txt
+++ b/intl/icu/source/data/locales/hsb.txt
-@@ -480,21 +480,25 @@ hsb{
+@@ -499,28 +499,32 @@ hsb{
+ MMMMW{
+ few{"W. 'tydźeń' MMMM"}
+ one{"W. 'tydźeń' MMMM"}
other{"W. 'tydźeń' MMMM"}
two{"W. 'tydźeń' MMMM"}
}
@@ -43,6 +53,7 @@ diff --git a/intl/icu/source/data/locales/hsb.txt b/intl/icu/source/data/locales
h{"h a"}
hm{"h:mm a"}
hms{"h:mm:ss a"}
+ hv{"h 'hodź'. a v"}
yM{"M.y"}
yMEd{"E, d.M.y"}
+ yMM{"MM y"}
@@ -56,3 +67,6 @@ diff --git a/intl/icu/source/data/locales/hsb.txt b/intl/icu/source/data/locales
yQQQQ{"QQQQ y"}
yw{
few{"w. 'tydźeń' 'lěta' Y"}
+ one{"w. 'tydźeń' 'lěta' Y"}
+ other{"w. 'tydźeń' 'lěta' Y"}
+ two{"w. 'tydźeń' 'lěta' Y"}
diff --git a/intl/icu-patches/bug-1706949-wasi-workaround.diff b/intl/icu-patches/bug-1706949-wasi-workaround.diff
@@ -3,7 +3,6 @@
# WASI issue: https://github.com/WebAssembly/wasi-sdk/issues/180
diff --git a/intl/icu/source/common/putilimp.h b/intl/icu/source/common/putilimp.h
-index 5b95a68..7097232 100644
--- a/intl/icu/source/common/putilimp.h
+++ b/intl/icu/source/common/putilimp.h
@@ -105,10 +105,12 @@ typedef size_t uintptr_t;
@@ -46,10 +45,9 @@ index 5b95a68..7097232 100644
#ifdef U_HAVE_MMAP
diff --git a/intl/icu/source/common/umapfile.h b/intl/icu/source/common/umapfile.h
-index 92bd567..4ed1112 100644
--- a/intl/icu/source/common/umapfile.h
+++ b/intl/icu/source/common/umapfile.h
-@@ -38,10 +38,12 @@ U_CFUNC void uprv_unmapFile(UDataMemory *pData);
+@@ -38,10 +38,12 @@ U_CFUNC void uprv_unmapFile(UDataMemory
#define MAP_POSIX 2
#define MAP_STDIO 3
@@ -63,10 +61,11 @@ index 92bd567..4ed1112 100644
# define MAP_IMPLEMENTATION MAP_POSIX
#else /* unknown platform, no memory map implementation: use stdio.h and uprv_malloc() instead */
diff --git a/intl/icu/source/common/umutex.cpp b/intl/icu/source/common/umutex.cpp
-index ccbee99..6c3452c 100644
--- a/intl/icu/source/common/umutex.cpp
+++ b/intl/icu/source/common/umutex.cpp
-@@ -43,6 +43,7 @@ U_NAMESPACE_BEGIN
+@@ -41,10 +41,11 @@ U_NAMESPACE_BEGIN
+ *
+ * ICU Mutex wrappers.
*
*************************************************************************************************/
@@ -74,7 +73,11 @@ index ccbee99..6c3452c 100644
namespace {
std::mutex *initMutex;
std::condition_variable *initCondition;
-@@ -55,9 +56,11 @@ std::once_flag initFlag;
+
+ // The ICU global mutex.
+@@ -53,32 +54,38 @@ UMutex globalMutex;
+
+ std::once_flag initFlag;
std::once_flag *pInitFlag = &initFlag;
} // Anonymous namespace
@@ -86,7 +89,8 @@ index ccbee99..6c3452c 100644
initMutex->~mutex();
initCondition->~condition_variable();
UMutex::cleanup();
-@@ -66,17 +69,21 @@ static UBool U_CALLCONV umtx_cleanup() {
+
+ // Reset the once_flag, by destructing it and creating a fresh one in its place.
// Do not use this trick anywhere else in ICU; use umtx_initOnce, not std::call_once().
pInitFlag->~once_flag();
pInitFlag = new(&initFlag) std::once_flag();
@@ -108,7 +112,11 @@ index ccbee99..6c3452c 100644
std::mutex *UMutex::getMutex() {
std::mutex *retPtr = fMutex.load(std::memory_order_acquire);
if (retPtr == nullptr) {
-@@ -93,14 +100,17 @@ std::mutex *UMutex::getMutex() {
+ std::call_once(*pInitFlag, umtx_init);
+ std::lock_guard<std::mutex> guard(*initMutex);
+@@ -91,41 +98,48 @@ std::mutex *UMutex::getMutex() {
+ }
+ }
U_ASSERT(retPtr != nullptr);
return retPtr;
}
@@ -126,7 +134,9 @@ index ccbee99..6c3452c 100644
next = m->fListLink;
m->fListLink = nullptr;
}
-@@ -110,20 +120,24 @@ void UMutex::cleanup() {
+ gListHead = nullptr;
+ }
+
U_CAPI void U_EXPORT2
umtx_lock(UMutex *mutex) {
@@ -151,7 +161,11 @@ index ccbee99..6c3452c 100644
}
-@@ -143,18 +157,22 @@ umtx_unlock(UMutex* mutex)
+ /*************************************************************************************************
+ *
+@@ -141,22 +155,26 @@ umtx_unlock(UMutex* mutex)
+ // that knows the C++ types involved. This function returns true if
+ // the caller needs to call the Init function.
//
U_COMMON_API UBool U_EXPORT2
umtx_initImplPreInit(UInitOnce &uio) {
@@ -174,7 +188,11 @@ index ccbee99..6c3452c 100644
return false;
}
}
-@@ -168,11 +186,13 @@ umtx_initImplPreInit(UInitOnce &uio) {
+
+
+@@ -166,15 +184,17 @@ umtx_initImplPreInit(UInitOnce &uio) {
+ // Some threads may be racing to test the fState variable outside of the mutex,
+ // requiring the use of store/release when changing its value.
U_COMMON_API void U_EXPORT2
umtx_initImplPostInit(UInitOnce &uio) {
@@ -188,11 +206,14 @@ index ccbee99..6c3452c 100644
}
U_NAMESPACE_END
+
+ /*************************************************************************************************
diff --git a/intl/icu/source/common/umutex.h b/intl/icu/source/common/umutex.h
-index 8d76b3f..c1a58db 100644
--- a/intl/icu/source/common/umutex.h
+++ b/intl/icu/source/common/umutex.h
-@@ -20,9 +20,12 @@
+@@ -18,13 +18,16 @@
+ */
+
#ifndef UMUTEX_H
#define UMUTEX_H
@@ -205,24 +226,9 @@ index 8d76b3f..c1a58db 100644
#include <type_traits>
#include "unicode/utypes.h"
-@@ -37,6 +40,8 @@
- #error U_USER_ATOMICS and U_USER_MUTEX_H are not supported
- #endif
-
-+#ifndef __wasi__
-+
- // Export an explicit template instantiation of std::atomic<int32_t>.
- // When building DLLs for Windows this is required as it is used as a data member of the exported SharedObject class.
- // See digitlst.h, pluralaffix.h, datefmt.h, and others for similar examples.
-@@ -61,6 +66,7 @@ template struct std::atomic<std::mutex *>;
- #endif
- #endif
-
-+#endif
-
- U_NAMESPACE_BEGIN
-
-@@ -68,10 +68,12 @@ U_NAMESPACE_BEGIN
+ #include "unicode/uclean.h"
+ #include "unicode/uobject.h"
+@@ -43,10 +46,12 @@ U_NAMESPACE_BEGIN
*
* Low Level Atomic Operations, ICU wrappers for.
*
@@ -235,7 +241,7 @@ index 8d76b3f..c1a58db 100644
inline int32_t umtx_loadAcquire(u_atomic_int32_t &var) {
return var.load(std::memory_order_acquire);
}
-@@ -86,10 +88,31 @@ inline int32_t umtx_atomic_inc(u_atomic_int32_t *var) {
+@@ -61,10 +66,31 @@ inline int32_t umtx_atomic_inc(u_atomic_
inline int32_t umtx_atomic_dec(u_atomic_int32_t *var) {
return var->fetch_sub(1) - 1;
@@ -267,26 +273,26 @@ index 8d76b3f..c1a58db 100644
*
* UInitOnce Definitions.
*
-@@ -225,21 +248,29 @@ class U_COMMON_API UMutex {
- UMutex &operator =(const UMutex &other) = delete;
- void *operator new(size_t) = delete;
+@@ -211,21 +237,29 @@ public:
+ U_COMMON_API UMutex& operator=(const UMutex& other) = delete;
+ U_COMMON_API void* operator new(size_t) = delete;
// requirements for C++ BasicLockable, allows UMutex to work with std::lock_guard
- void lock() {
+ U_COMMON_API void lock() {
+#ifndef __wasi__
std::mutex *m = fMutex.load(std::memory_order_acquire);
if (m == nullptr) { m = getMutex(); }
m->lock();
+#endif
-+ }
-+ void unlock() {
+ }
+- U_COMMON_API void unlock() { fMutex.load(std::memory_order_relaxed)->unlock(); }
++ U_COMMON_API void unlock() {
+#ifndef __wasi__
+ fMutex.load(std::memory_order_relaxed)->unlock();
+#endif
- }
-- void unlock() { fMutex.load(std::memory_order_relaxed)->unlock(); }
++ }
- static void cleanup();
+ U_COMMON_API static void cleanup();
private:
+#ifndef __wasi__
@@ -298,7 +304,7 @@ index 8d76b3f..c1a58db 100644
* and the underlying std::mutex destructed, by u_cleanup().
*/
UMutex *fListLink { nullptr };
-@@ -247,11 +278,13 @@ class U_COMMON_API UMutex {
+@@ -233,11 +267,13 @@ private:
/** Out-of-line function to lazily initialize a UMutex on first use.
* Initial fast check is inline, in lock(). The returned value may never
@@ -312,7 +318,6 @@ index 8d76b3f..c1a58db 100644
/* Lock a mutex.
* @param mutex The given mutex to be locked. Pass NULL to specify
-
diff --git a/intl/icu/source/common/unifiedcache.cpp b/intl/icu/source/common/unifiedcache.cpp
--- a/intl/icu/source/common/unifiedcache.cpp
+++ b/intl/icu/source/common/unifiedcache.cpp
@@ -322,9 +327,8 @@ diff --git a/intl/icu/source/common/unifiedcache.cpp b/intl/icu/source/common/un
#include "unifiedcache.h"
#include <algorithm> // For std::max()
--#include <mutex>
+#ifndef __wasi__
-+ #include <mutex>
+ #include <mutex>
+#endif
#include "uassert.h"
@@ -341,7 +345,7 @@ diff --git a/intl/icu/source/common/unifiedcache.cpp b/intl/icu/source/common/un
static const int32_t MAX_EVICT_ITERATIONS = 10;
static const int32_t DEFAULT_MAX_UNUSED = 1000;
static const int32_t DEFAULT_PERCENTAGE_OF_IN_USE = 100;
-@@ -32,14 +36,16 @@ static const int32_t DEFAULT_PERCENTAGE_OF_IN_USE = 100;
+@@ -32,14 +36,16 @@ static const int32_t DEFAULT_PERCENTAGE_
U_CDECL_BEGIN
static UBool U_CALLCONV unifiedcache_cleanup() {
gCacheInitOnce.reset();
@@ -509,10 +513,11 @@ diff --git a/intl/icu/source/common/unifiedcache.cpp b/intl/icu/source/common/un
const UHashElement *element,
const SharedObject *&value,
diff --git a/intl/icu/source/i18n/decContext.h b/intl/icu/source/i18n/decContext.h
-index 59ab65e..20f3526 100644
--- a/intl/icu/source/i18n/decContext.h
+++ b/intl/icu/source/i18n/decContext.h
-@@ -61,7 +61,9 @@
+@@ -59,11 +59,13 @@
+
+ #if !defined(int32_t)
/* #include <stdint.h> */ /* C99 standard integers */
#endif
#include <stdio.h> /* for printf, etc. */
@@ -522,11 +527,14 @@ index 59ab65e..20f3526 100644
/* Extended flags setting -- set this to 0 to use only IEEE flags */
#if !defined(DECEXTFLAG)
+ #define DECEXTFLAG 1 /* 1=enable extended flags */
+ #endif
diff --git a/intl/icu/source/i18n/decimfmt.cpp b/intl/icu/source/i18n/decimfmt.cpp
-index daa1129..c8f1eda 100644
--- a/intl/icu/source/i18n/decimfmt.cpp
+++ b/intl/icu/source/i18n/decimfmt.cpp
-@@ -480,8 +480,13 @@ DecimalFormat& DecimalFormat::operator=(const DecimalFormat& rhs) {
+@@ -478,12 +478,17 @@ DecimalFormat& DecimalFormat::operator=(
+ }
+
DecimalFormat::~DecimalFormat() {
if (fields == nullptr) { return; }
@@ -540,7 +548,11 @@ index daa1129..c8f1eda 100644
delete fields;
}
-@@ -1626,8 +1631,13 @@ void DecimalFormat::touch(UErrorCode& status) {
+ DecimalFormat* DecimalFormat::clone() const {
+ // can only clone valid objects.
+@@ -1635,12 +1640,17 @@ void DecimalFormat::touch(UErrorCode& st
+
+ // Do this after fields->exportedProperties are set up
setupFastFormat();
// Delete the parsers if they were made previously
@@ -554,7 +566,11 @@ index daa1129..c8f1eda 100644
// In order for the getters to work, we need to populate some fields in NumberFormat.
NumberFormat::setCurrency(fields->exportedProperties.currency.get(status).getISOCurrency(), status);
-@@ -1662,7 +1672,11 @@ const numparse::impl::NumberParserImpl* DecimalFormat::getParser(UErrorCode& sta
+ NumberFormat::setMaximumIntegerDigits(fields->exportedProperties.maximumIntegerDigits);
+ NumberFormat::setMinimumIntegerDigits(fields->exportedProperties.minimumIntegerDigits);
+@@ -1671,11 +1681,15 @@ const numparse::impl::NumberParserImpl*
+ if (U_FAILURE(status)) {
+ return nullptr;
}
// First try to get the pre-computed parser
@@ -566,7 +582,11 @@ index daa1129..c8f1eda 100644
if (ptr != nullptr) {
return ptr;
}
-@@ -1681,6 +1695,7 @@ const numparse::impl::NumberParserImpl* DecimalFormat::getParser(UErrorCode& sta
+
+ // Try computing the parser on our own
+@@ -1690,25 +1704,34 @@ const numparse::impl::NumberParserImpl*
+
+ // Note: ptr starts as nullptr; during compare_exchange,
// it is set to what is actually stored in the atomic
// if another thread beat us to computing the parser object.
auto* nonConstThis = const_cast<DecimalFormat*>(this);
@@ -574,7 +594,8 @@ index daa1129..c8f1eda 100644
if (!nonConstThis->fields->atomicParser.compare_exchange_strong(ptr, temp)) {
// Another thread beat us to computing the parser
delete temp;
-@@ -1689,13 +1704,21 @@ const numparse::impl::NumberParserImpl* DecimalFormat::getParser(UErrorCode& sta
+ return ptr;
+ } else {
// Our copy of the parser got stored in the atomic
return temp;
}
@@ -596,7 +617,11 @@ index daa1129..c8f1eda 100644
if (ptr != nullptr) {
return ptr;
}
-@@ -1710,6 +1733,7 @@ const numparse::impl::NumberParserImpl* DecimalFormat::getCurrencyParser(UErrorC
+
+ // Try computing the parser on our own
+@@ -1719,18 +1742,23 @@ const numparse::impl::NumberParserImpl*
+ }
+
// Note: ptr starts as nullptr; during compare_exchange, it is set to what is actually stored in the
// atomic if another thread beat us to computing the parser object.
auto* nonConstThis = const_cast<DecimalFormat*>(this);
@@ -604,7 +629,8 @@ index daa1129..c8f1eda 100644
if (!nonConstThis->fields->atomicCurrencyParser.compare_exchange_strong(ptr, temp)) {
// Another thread beat us to computing the parser
delete temp;
-@@ -1718,6 +1742,10 @@ const numparse::impl::NumberParserImpl* DecimalFormat::getCurrencyParser(UErrorC
+ return ptr;
+ } else {
// Our copy of the parser got stored in the atomic
return temp;
}
@@ -615,11 +641,14 @@ index daa1129..c8f1eda 100644
}
void
+ DecimalFormat::fieldPositionHelper(
+ const UFormattedNumberData& formatted,
diff --git a/intl/icu/source/i18n/number_mapper.h b/intl/icu/source/i18n/number_mapper.h
-index 9ecd776..d094289 100644
--- a/intl/icu/source/i18n/number_mapper.h
+++ b/intl/icu/source/i18n/number_mapper.h
-@@ -7,7 +7,6 @@
+@@ -5,18 +5,21 @@
+
+ #if !UCONFIG_NO_FORMATTING
#ifndef __NUMBER_MAPPER_H__
#define __NUMBER_MAPPER_H__
@@ -627,7 +656,7 @@ index 9ecd776..d094289 100644
#include "number_types.h"
#include "unicode/currpinf.h"
#include "standardplural.h"
-@@ -15,6 +14,10 @@
+ #include "number_patternstring.h"
#include "number_currencysymbols.h"
#include "numparse_impl.h"
@@ -636,9 +665,13 @@ index 9ecd776..d094289 100644
+#endif
+
U_NAMESPACE_BEGIN
- namespace number {
- namespace impl {
-@@ -193,10 +196,18 @@ struct DecimalFormatFields : public UMemory {
+ namespace number::impl {
+
+ class AutoAffixPatternProvider;
+ class CurrencyPluralInfoAffixProvider;
+@@ -194,14 +197,22 @@ struct DecimalFormatFields : public UMem
+ * #format} method uses the formatter directly without needing to synchronize.
+ */
LocalizedNumberFormatter formatter;
/** The lazy-computed parser for .parse() */
@@ -657,10 +690,12 @@ index 9ecd776..d094289 100644
/** Small object ownership warehouse for the formatter and parser */
DecimalFormatWarehouse warehouse;
+
+ /** The effective properties as exported from the formatter object. Used by some getters. */
diff --git a/intl/icu/source/i18n/numrange_fluent.cpp b/intl/icu/source/i18n/numrange_fluent.cpp
--- a/intl/icu/source/i18n/numrange_fluent.cpp
+++ b/intl/icu/source/i18n/numrange_fluent.cpp
-@@ -246,33 +246,53 @@ LocalizedNumberRangeFormatter::LocalizedNumberRangeFormatter(LocalizedNumberRang
+@@ -246,33 +246,53 @@ LocalizedNumberRangeFormatter::Localized
LocalizedNumberRangeFormatter::LocalizedNumberRangeFormatter(NFS<LNF>&& src) noexcept
: NFS<LNF>(std::move(src)) {
@@ -714,7 +749,7 @@ diff --git a/intl/icu/source/i18n/numrange_fluent.cpp b/intl/icu/source/i18n/num
LocalizedNumberRangeFormatter::LocalizedNumberRangeFormatter(const RangeMacroProps& macros, const Locale& locale) {
fMacros = macros;
fMacros.locale = locale;
-@@ -363,11 +383,15 @@ LocalizedNumberRangeFormatter::getFormatter(UErrorCode& status) const {
+@@ -363,11 +383,15 @@ LocalizedNumberRangeFormatter::getFormat
if (U_FAILURE(status)) {
return nullptr;
}
@@ -730,7 +765,7 @@ diff --git a/intl/icu/source/i18n/numrange_fluent.cpp b/intl/icu/source/i18n/num
}
// Try computing the formatter on our own
-@@ -378,17 +378,22 @@ LocalizedNumberRangeFormatter::getFormatter(UErrorCode& status) const {
+@@ -378,17 +402,22 @@ LocalizedNumberRangeFormatter::getFormat
// Note: ptr starts as nullptr; during compare_exchange,
// it is set to what is actually stored in the atomic
@@ -754,10 +789,11 @@ diff --git a/intl/icu/source/i18n/numrange_fluent.cpp b/intl/icu/source/i18n/num
#endif /* #if !UCONFIG_NO_FORMATTING */
diff --git a/intl/icu/source/i18n/unicode/numberrangeformatter.h b/intl/icu/source/i18n/unicode/numberrangeformatter.h
-index b9a4600..0ba2fa0 100644
--- a/intl/icu/source/i18n/unicode/numberrangeformatter.h
+++ b/intl/icu/source/i18n/unicode/numberrangeformatter.h
-@@ -10,7 +10,6 @@
+@@ -8,18 +8,21 @@
+
+ #if U_SHOW_CPLUSPLUS_API
#if !UCONFIG_NO_FORMATTING
@@ -765,7 +801,7 @@ index b9a4600..0ba2fa0 100644
#include "unicode/appendable.h"
#include "unicode/fieldpos.h"
#include "unicode/formattedvalue.h"
-@@ -18,6 +17,10 @@
+ #include "unicode/fpositer.h"
#include "unicode/numberformatter.h"
#include "unicode/unumberrangeformatter.h"
@@ -776,18 +812,12 @@ index b9a4600..0ba2fa0 100644
/**
* \file
* \brief C++ API: Library for localized formatting of number, currency, and unit ranges.
-@@ -77,7 +80,9 @@ struct UFormattedNumberRangeImpl;
- } // namespace icu::number
- U_NAMESPACE_END
-
-+#ifndef __wasi__
- template struct U_I18N_API std::atomic< U_NAMESPACE_QUALIFIER number::impl::NumberRangeFormatterImpl*>;
-+#endif
-
- U_NAMESPACE_BEGIN
- namespace number { // icu::number
-@@ -546,7 +551,11 @@ class U_I18N_API LocalizedNumberRangeFormatter
- ~LocalizedNumberRangeFormatter();
+ *
+ * The main entrypoint to the formatting of ranges of numbers, including currencies and other units of measurement.
+@@ -559,11 +562,15 @@ class U_I18N_API_CLASS LocalizedNumberRa
+ * @stable ICU 63
+ */
+ U_I18N_API ~LocalizedNumberRangeFormatter();
private:
+#ifndef __wasi__
@@ -798,3 +828,5 @@ index b9a4600..0ba2fa0 100644
const impl::NumberRangeFormatterImpl* getFormatter(UErrorCode& stauts) const;
+ explicit LocalizedNumberRangeFormatter(
+ const NumberRangeFormatterSettings<LocalizedNumberRangeFormatter>& other);
diff --git a/intl/icu-patches/bug-1954138-dtitvfmt-adopt-calendar.diff b/intl/icu-patches/bug-1954138-dtitvfmt-adopt-calendar.diff
@@ -1,7 +1,8 @@
diff --git a/intl/icu/source/i18n/dtitvfmt.cpp b/intl/icu/source/i18n/dtitvfmt.cpp
--- a/intl/icu/source/i18n/dtitvfmt.cpp
+++ b/intl/icu/source/i18n/dtitvfmt.cpp
-@@ -631,16 +631,38 @@ DateIntervalFormat::getTimeZone() const
+@@ -630,16 +630,38 @@ DateIntervalFormat::getTimeZone() const
+ {
if (fDateFormat != nullptr) {
Mutex lock(&gFormatterMutex);
return fDateFormat->getTimeZone();
@@ -9,7 +10,7 @@ diff --git a/intl/icu/source/i18n/dtitvfmt.cpp b/intl/icu/source/i18n/dtitvfmt.c
// If fDateFormat is nullptr (unexpected), create default timezone.
return *(TimeZone::createDefault());
}
-
++
+void DateIntervalFormat::adoptCalendar(Calendar *calendarToAdopt) {
+ if (fDateFormat != nullptr) {
+ fDateFormat->adoptCalendar(calendarToAdopt);
@@ -31,7 +32,7 @@ diff --git a/intl/icu/source/i18n/dtitvfmt.cpp b/intl/icu/source/i18n/dtitvfmt.c
+ fToCalendar = calendar->clone();
+ }
+}
-+
+
void
DateIntervalFormat::setContext(UDisplayContext value, UErrorCode& status)
{
@@ -39,24 +40,23 @@ diff --git a/intl/icu/source/i18n/dtitvfmt.cpp b/intl/icu/source/i18n/dtitvfmt.c
return;
if (static_cast<UDisplayContextType>(static_cast<uint32_t>(value) >> 8) == UDISPCTX_TYPE_CAPITALIZATION) {
fCapitalizationContext = value;
- } else {
diff --git a/intl/icu/source/i18n/unicode/dtitvfmt.h b/intl/icu/source/i18n/unicode/dtitvfmt.h
--- a/intl/icu/source/i18n/unicode/dtitvfmt.h
+++ b/intl/icu/source/i18n/unicode/dtitvfmt.h
-@@ -637,16 +637,23 @@ public:
+@@ -625,16 +625,23 @@ public:
/**
* Sets the time zone for the calendar used by this DateIntervalFormat object.
* @param zone the new time zone.
* @stable ICU 4.8
*/
- virtual void setTimeZone(const TimeZone& zone);
+ U_I18N_API virtual void setTimeZone(const TimeZone& zone);
/**
+ * Sets the calendar used by this DateIntervalFormat object. The caller no longer owns
+ * the Calendar object and should not delete it after this call.
+ * @param calendarToAdopt the Calendar to be adopted.
+ */
-+ virtual void adoptCalendar(Calendar *calendarToAdopt);
++ U_I18N_API virtual void adoptCalendar(Calendar *calendarToAdopt);
+
+ /**
* Set a particular UDisplayContext value in the formatter, such as
diff --git a/intl/icu-patches/double-conversion.diff b/intl/icu-patches/double-conversion.diff
@@ -152,8 +152,7 @@ diff --git a/intl/icu/source/i18n/number_utils.cpp b/intl/icu/source/i18n/number
diff --git a/intl/icu/source/i18n/units_converter.cpp b/intl/icu/source/i18n/units_converter.cpp
--- a/intl/icu/source/i18n/units_converter.cpp
+++ b/intl/icu/source/i18n/units_converter.cpp
-@@ -2,17 +2,21 @@
- // License & terms of use: http://www.unicode.org/copyright.html
+@@ -3,17 +3,21 @@
#include "unicode/utypes.h"
@@ -161,6 +160,7 @@ diff --git a/intl/icu/source/i18n/units_converter.cpp b/intl/icu/source/i18n/uni
#include "charstr.h"
#include "cmemory.h"
+ #include "cstring.h"
+#ifdef JS_HAS_INTL_API
+#include "double-conversion/string-to-double.h"
+#else
@@ -174,7 +174,7 @@ diff --git a/intl/icu/source/i18n/units_converter.cpp b/intl/icu/source/i18n/uni
#include "unicode/stringpiece.h"
#include "units_converter.h"
#include <algorithm>
-@@ -101,17 +105,21 @@ void U_I18N_API Factor::substituteConsta
+@@ -105,17 +109,21 @@ void Factor::substituteConstants() {
this->constantExponents[i] = 0;
}
}