Skip to content

Commit 49fcd32

Browse files
boingoingjasongin
authored andcommitted
napi: Fix two build issues when building with GCC (nodejs#70)
First, GCC doesn't seem to implement an interface keyword. Workaround here is to use struct instead of interface. This is nodejs/abi-stable-node#69 Second, GCC doesn't support the flavor of static_assert which takes a single parameter. Just added a second parameter message here.
1 parent 739f4d8 commit 49fcd32

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/node_jsvmapi.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ namespace v8impl {
189189

190190
// Interface implemented by classes that wrap V8 function and property
191191
// callback info.
192-
interface CallbackWrapper {
192+
struct CallbackWrapper {
193193
virtual napi_value This() = 0;
194194
virtual napi_value Holder() = 0;
195195
virtual bool IsConstructCall() = 0;
@@ -537,7 +537,8 @@ void napi_clear_last_error() {
537537
}
538538

539539
const napi_extended_error_info* napi_get_last_error_info() {
540-
static_assert(sizeof(error_messages) / sizeof(*error_messages) == napi_status_last);
540+
static_assert(sizeof(error_messages) / sizeof(*error_messages) == napi_status_last,
541+
"Count of error messages must match count of error values");
541542
assert(static_last_error.error_code < napi_status_last);
542543

543544
// Wait until someone requests the last error information to fetch the error message string

0 commit comments

Comments
 (0)