--- src/objects/js-temporal-zoneinfo64.cc.orig 2026-10-08 06:17:53 UTC +++ src/objects/js-temporal-zoneinfo64.cc @@ -11,7 +11,11 @@ #include "temporal_rs/TimeZone.hpp" #ifdef V8_INTL_SUPPORT -#include "udatamem.h" +#include "unicode/udata.h" +// udatamem.h is internal to ICU and not installed by devel/icu; declare the +// two accessors from it that libicuuc exports. +U_CAPI int32_t U_EXPORT2 udata_getLength(const UDataMemory* pData); +U_CAPI const void* U_EXPORT2 udata_getRawMemory(const UDataMemory* pData); #else // Defined in builtins-temporal-zoneinfo64-data.cc, generated by // include-file-as-bytes.py @@ -32,8 +36,16 @@ ZoneInfo64Provider::ZoneInfo64Provider() { } // NOT udata_getLength: this ignores the header, // and we're parsing resb files with the header - auto length = memory->length; + // Without UDataMemory's definition, add the header back to what + // udata_getLength reports. const void* data = udata_getRawMemory(memory); + auto body_length = udata_getLength(memory); + if (body_length < 0) { + provider = temporal_rs::Provider::empty(); + return; + } + auto length = body_length + (static_cast(udata_getMemory(memory)) - + static_cast(data)); DCHECK_WITH_MSG(length % 4 == 0, "ICU4C should align udata to uint32_t"); if (length % 4 != 0) { // This really shouldn't happen: ICU4C aligns these files