Skip to content

Commit 9500e05

Browse files
committed
src: make node_javascript.cc compile with GCC 4.8
1 parent d9490e3 commit 9500e05

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/node_javascript.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ using v8::String;
1616
template <typename T, size_t N, T P>
1717
struct ExternalStringResource;
1818

19-
template <size_t N, const char (&P)[N]>
20-
struct ExternalStringResource<const char[N], N, P>
19+
template <size_t N, const char* P>
20+
struct ExternalStringResource<const char*, N, P>
2121
: public String::ExternalOneByteStringResource {
2222
const char* data() const override { return P; }
2323
size_t length() const override { return N; }
2424
void Dispose() override { /* Default calls `delete this`. */ }
2525
};
2626

27-
template <size_t N, const uint16_t (&P)[N]>
28-
struct ExternalStringResource<const uint16_t[N], N, P>
27+
template <size_t N, const uint16_t* P>
28+
struct ExternalStringResource<const uint16_t*, N, P>
2929
: public String::ExternalStringResource {
3030
const uint16_t* data() const override { return P; }
3131
size_t length() const override { return N; }
@@ -34,7 +34,7 @@ struct ExternalStringResource<const uint16_t[N], N, P>
3434

3535
// id##_data is defined in node_natives.h.
3636
#define V(id) \
37-
static ExternalStringResource<decltype(id##_data), \
37+
static ExternalStringResource<decltype(&id##_data[0]), \
3838
arraysize(id##_data), \
3939
id##_data> id##_external_data;
4040
NODE_NATIVES_MAP(V)

tools/js2c.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def ReadMacros(lines):
189189
SOURCES = """\
190190
static const uint8_t {escaped_id}_name[] = {{
191191
{name}}};
192-
static const {ctype} {escaped_id}_data[] = {{
192+
static constexpr const {ctype} {escaped_id}_data[] = {{
193193
{data}}};
194194
"""
195195

0 commit comments

Comments
 (0)