1111#include " temporal_rs/TimeZone.hpp"
1212
1313#ifdef V8_INTL_SUPPORT
14- #include " udatamem.h"
14+ #include " unicode/udata.h"
15+ typedef struct {
16+ uint16_t headerSize;
17+ uint8_t magic1;
18+ uint8_t magic2;
19+ } MappedData;
20+ typedef struct {
21+ MappedData dataHeader;
22+ UDataInfo info;
23+ } DataHeader;
24+ typedef struct {
25+ void * Lookup;
26+ void * NumEntries;
27+ } commonDataFuncs;
28+ struct UDataMemory {
29+ const commonDataFuncs *vFuncs; /* Function Pointers for accessing TOC */
30+
31+ const DataHeader *pHeader; /* Header of the memory being described by this */
32+ /* UDataMemory object. */
33+ const void *toc; /* For common memory, table of contents for */
34+ /* the pieces within. */
35+ UBool heapAllocated; /* True if this UDataMemory Object is on the */
36+ /* heap and thus needs to be deleted when closed. */
37+
38+ void *mapAddr; /* For mapped or allocated memory, the start addr. */
39+ /* Only non-null if a close operation should unmap */
40+ /* the associated data. */
41+ void *map; /* Handle, or other data, OS dependent. */
42+ /* Only non-null if a close operation should unmap */
43+ /* the associated data, and additional info */
44+ /* beyond the mapAddr is needed to do that. */
45+ int32_t length; /* Length of the data in bytes; -1 if unknown. */
46+ };
1547#else
1648// Defined in builtins-temporal-zoneinfo64-data.cc, generated by
1749// include-file-as-bytes.py
18- extern " C " uint32_t zoneinfo64_static_data[];
19- extern " C " size_t zoneinfo64_static_data_len;
50+ static uint32_t zoneinfo64_static_data[] = {} ;
51+ static size_t zoneinfo64_static_data_len = 0 ;
2052#endif
2153
2254namespace v8 ::internal {
@@ -33,7 +65,7 @@ ZoneInfo64Provider::ZoneInfo64Provider() {
3365 // NOT udata_getLength: this ignores the header,
3466 // and we're parsing resb files with the header
3567 auto length = memory->length ;
36- const void * data = udata_getRawMemory (memory);
68+ const void * data = udata_getMemory (memory);
3769 DCHECK_WITH_MSG (length % 4 == 0 , " ICU4C should align udata to uint32_t" );
3870 if (length % 4 != 0 ) {
3971 // This really shouldn't happen: ICU4C aligns these files
0 commit comments