[Pkg-javascript-commits] [node-expat] 111/371: updates files to rename the native module to node_expat to be able to load it in windows (native modules with - fail to load)

Jonas Smedegaard dr at jones.dk
Sun Feb 28 09:59:51 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository node-expat.

commit 03cabccde1804f6138c3ad5dc5806063c34bab25
Author: Andreas Botsikas <abot at epu.ntua.gr>
Date:   Fri Dec 16 08:06:09 2011 +0200

    updates files to rename the native module to node_expat to be able to load it in windows (native modules with - fail to load)
---
 lib/node-expat.js |  7 ++-----
 node-expat.cc     | 15 ++++++++-------
 wscript           |  2 +-
 3 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/lib/node-expat.js b/lib/node-expat.js
index cad557f..47da4be 100644
--- a/lib/node-expat.js
+++ b/lib/node-expat.js
@@ -1,10 +1,7 @@
 var EventEmitter = require('events').EventEmitter;
 var util = require('util');
-try {
-	var expat = require('../build/Release/node-expat');
-} catch(e) {
-	var expat = require('../build/default/node-expat');
-}
+// Only support nodejs v0.6 and on so no need to look for older module location
+var expat = require('../build/Release/node_expat.node');
 
 /**
  * Simple wrapper because EventEmitter has turned pure-JS as of node
diff --git a/node-expat.cc b/node-expat.cc
index 6243f07..bc29250 100644
--- a/node-expat.cc
+++ b/node-expat.cc
@@ -369,10 +369,11 @@ private:
   }
 };
 
-
-
-extern "C" void init(Handle<Object> target)
-{
-  HandleScope scope;
-  Parser::Initialize(target);
-}
+extern "C" {
+  static void init (Handle<Object> target)
+  {
+    Parser::Initialize(target);
+  }
+  //Changed the name cause I couldn't load the module with - in their names
+  NODE_MODULE(node_expat, init);
+};
diff --git a/wscript b/wscript
index 66922b9..7f21af3 100644
--- a/wscript
+++ b/wscript
@@ -17,7 +17,7 @@ def configure(conf):
 
 def build(bld):
   obj = bld.new_task_gen('cxx', 'shlib', 'node_addon')
-  obj.target = 'node-expat'
+  obj.target = 'node_expat'
   obj.source = 'node-expat.cc'
   obj.lib = 'expat'
   obj.uselib = 'EXPAT'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-expat.git



More information about the Pkg-javascript-commits mailing list