Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1 from Obvious/danfuzz-node-8

Danfuzz node 8
  • Loading branch information...
commit e9a78bc2b786beea40e8eac1dd2555b3b492e4ae 2 parents 4301182 + 06bd69f
@danfuzz danfuzz authored
View
2  .gitignore
@@ -1,4 +1,2 @@
-.lock-wscript
-.waf*
build
oidNative.node
View
8 binding.gyp
@@ -0,0 +1,8 @@
+{
+ 'targets': [
+ {
+ 'target_name': 'oidNative',
+ 'sources': [ 'src/oidNative.cc' ],
+ }
+ ]
+}
View
4 package.json
@@ -1,6 +1,6 @@
{
"name": "oid",
- "version": "0.4.6",
+ "version": "0.5.0",
"keywords":
["object", "id", "identity", "hash", "hashcode", "objid", "oid"],
"description":
@@ -31,7 +31,7 @@
},
"scripts": {
- "install": "node-waf configure build",
+ "install": "node-gyp configure build; mkdir -p bin; mv build/Release/*.node bin",
"test": "node test/test.js"
}
}
View
2  src/oidNative.cc
@@ -57,7 +57,7 @@ Handle<Value> NumberIdHash(const Arguments& args) {
hood.doubleValue = num->Value();
int hash = 56081; // A prime number.
- for (int i = 0; i < sizeof(double); i++) {
+ for (size_t i = 0; i < sizeof(double); i++) {
hash = (hash * 31) + hood.buffer[i];
}
View
39 wscript
@@ -1,39 +0,0 @@
-# Build script based on examples from the NodeJS docs and
-# from node-rsa
-
-import Options
-import shutil
-from os import chmod, mkdir
-from os.path import exists
-
-srcdir = '.'
-blddir = 'build'
-VERSION = '0.0.1'
-
-def set_options(opt):
- opt.tool_options('compiler_cxx')
-
-def configure(conf):
- conf.check_tool('compiler_cxx')
- conf.check_tool('node_addon')
-
-def build(bld):
- obj = bld.new_task_gen('cxx', 'shlib', 'node_addon')
- obj.target = 'oidNative'
- obj.source = 'src/oidNative.cc'
-
-def shutdown():
- dir = 'bin'
- target = 'oidNative.node'
- dirTarget = dir + '/' + target
- if Options.commands['clean']:
- if exists(dir): shutil.rmtree(dir)
- if exists('build'): shutil.rmtree('build')
- if Options.commands['build']:
- if not exists(dir): mkdir(dir)
- if exists('build/default/' + target):
- shutil.copyfile('build/default/' + target, dirTarget)
- if exists('build/Release/' + target):
- shutil.copyfile('build/Release/' + target, dirTarget)
- if exists(dirTarget):
- chmod(dirTarget, 0755)
Please sign in to comment.
Something went wrong with that request. Please try again.