Skip to content

Commit

Permalink
src: make node_javascript.cc compile with GCC 4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
aqrln committed Feb 3, 2017
1 parent d9490e3 commit 9500e05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/node_javascript.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ using v8::String;
template <typename T, size_t N, T P>
struct ExternalStringResource;

template <size_t N, const char (&P)[N]>
struct ExternalStringResource<const char[N], N, P>
template <size_t N, const char* P>
struct ExternalStringResource<const char*, N, P>
: public String::ExternalOneByteStringResource {
const char* data() const override { return P; }
size_t length() const override { return N; }
void Dispose() override { /* Default calls `delete this`. */ }
};

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

// id##_data is defined in node_natives.h.
#define V(id) \
static ExternalStringResource<decltype(id##_data), \
static ExternalStringResource<decltype(&id##_data[0]), \
arraysize(id##_data), \
id##_data> id##_external_data;
NODE_NATIVES_MAP(V)
Expand Down
2 changes: 1 addition & 1 deletion tools/js2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def ReadMacros(lines):
SOURCES = """\
static const uint8_t {escaped_id}_name[] = {{
{name}}};
static const {ctype} {escaped_id}_data[] = {{
static constexpr const {ctype} {escaped_id}_data[] = {{
{data}}};
"""

Expand Down

0 comments on commit 9500e05

Please sign in to comment.