summaryrefslogtreecommitdiff
path: root/test/addons/hello-world
diff options
context:
space:
mode:
authorNathan Rajlich <nathan@tootallnate.net>2012-02-25 11:18:45 -0800
committerBen Noordhuis <info@bnoordhuis.nl>2012-02-27 02:44:33 +0100
commitaa35564ca1c9f3854bc5f7983f2f00cb51f67ffe (patch)
treeb17d2362323f0184344538cc54af49b19f2b1f19 /test/addons/hello-world
parent3f1f2d149724b617418ac2212ac829b12b50d321 (diff)
downloadandroid-node-v8-aa35564ca1c9f3854bc5f7983f2f00cb51f67ffe.tar.gz
android-node-v8-aa35564ca1c9f3854bc5f7983f2f00cb51f67ffe.tar.bz2
android-node-v8-aa35564ca1c9f3854bc5f7983f2f00cb51f67ffe.zip
Use NODE_MODULE in the hello-world addon example.
Fixes Windows throwing "unknown error" when trying to require the .node file.
Diffstat (limited to 'test/addons/hello-world')
-rw-r--r--test/addons/hello-world/binding.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/addons/hello-world/binding.cc b/test/addons/hello-world/binding.cc
index 82e8c5583d..424fad8445 100644
--- a/test/addons/hello-world/binding.cc
+++ b/test/addons/hello-world/binding.cc
@@ -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);