Skip to content

Commit 139247a

Browse files
richardlauaduh95
andcommitted
deps: V8: avoid dependency on private ICU header
Patch out dependency on private ICU header file to allow compilation with either a shared ICU library or without ICU altogether. Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com> Signed-off-by: Richard Lau <richard.lau@ibm.com>
1 parent 018d4b8 commit 139247a

File tree

2 files changed

+37
-5
lines changed

2 files changed

+37
-5
lines changed

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# Reset this number to 0 on major V8 upgrades.
4040
# Increment by one for each non-official patch applied to deps/v8.
41-
'v8_embedder_string': '-node.17',
41+
'v8_embedder_string': '-node.18',
4242

4343
##### V8 defaults for Node.js #####
4444

deps/v8/src/objects/js-temporal-zoneinfo64.cc

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,44 @@
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

2254
namespace 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

Comments
 (0)