diff options
Diffstat (limited to 'test/addons/hello-world/binding.cc')
-rw-r--r-- | test/addons/hello-world/binding.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/addons/hello-world/binding.cc b/test/addons/hello-world/binding.cc index 944f563195..ba6a22d719 100644 --- a/test/addons/hello-world/binding.cc +++ b/test/addons/hello-world/binding.cc @@ -6,8 +6,12 @@ void Method(const v8::FunctionCallbackInfo<v8::Value>& args) { args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world")); } -void init(v8::Local<v8::Object> exports) { +#define CONCAT(a, b) CONCAT_HELPER(a, b) +#define CONCAT_HELPER(a, b) a##b +#define INITIALIZER CONCAT(node_register_module_v, NODE_MODULE_VERSION) + +extern "C" NODE_MODULE_EXPORT void INITIALIZER(v8::Local<v8::Object> exports, + v8::Local<v8::Value> module, + v8::Local<v8::Context> context) { NODE_SET_METHOD(exports, "hello", Method); } - -NODE_MODULE(NODE_GYP_MODULE_NAME, init) |