Use NODE_MODULE in the hello-world addon example.
authorNathan Rajlich <nathan@tootallnate.net>
Sat, 25 Feb 2012 19:18:45 +0000 (11:18 -0800)
committerBen Noordhuis <info@bnoordhuis.nl>
Mon, 27 Feb 2012 01:44:33 +0000 (02:44 +0100)
Fixes Windows throwing "unknown error" when trying to require the .node file.

test/addons/hello-world/binding.cc

index 82e8c5583dae82ffd0a8466c09311bc4e096513b..424fad8445add651ae7c50a248979e11d665d8c1 100644 (file)
@@ -3,10 +3,6 @@
 
 using namespace v8;
 
-extern "C" {
-  void init(Handle<Object> target);
-}
-
 Handle<Value> Method(const Arguments& args) {
   HandleScope scope;
   return scope.Close(String::New("world"));
@@ -15,3 +11,5 @@ Handle<Value> Method(const Arguments& args) {
 void init(Handle<Object> target) {
   NODE_SET_METHOD(target, "hello", Method);
 }
+
+NODE_MODULE(binding, init);