Skip to content

Commit

Permalink
[hashlib.cc] - Including node.h instead of ev.h and eio.h. node.h inc…
Browse files Browse the repository at this point in the history
…ludes these files correctly, which might move around from one version of node to the other. (So basically, node.h should be included instead of specifically including ev and eio.)

[README.md, makefile, package.json, test.js] - Changing the '/build/default/hashlib' path to '/build/Release/hashlib'. Node-waf, starting from node 0.5.5 uses the Release environment by default.
  • Loading branch information
Olivier Vaillancourt committed Nov 9, 2011
1 parent 3c0b26f commit 68d97cf
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -11,9 +11,9 @@

2) execute `node-waf configure build`

3) get module from `./build/default/hashlib.node`
3) get module from `./build/Release/hashlib.node`

You should use `var hashlib = require("./build/default/hashlib");` (way to module)
You should use `var hashlib = require("./build/Release/hashlib");` (way to module)

### way 2 (works if node are installed in default path)
1) go to the directory with hashlib library
Expand Down
3 changes: 1 addition & 2 deletions hashlib.cc
Expand Up @@ -11,8 +11,7 @@
#include <stdio.h>

#include <v8.h>
#include <ev.h>
#include <eio.h>
#include <node.h>
#include <fcntl.h>
#include <node_buffer.h>

Expand Down
2 changes: 1 addition & 1 deletion makefile
Expand Up @@ -5,7 +5,7 @@ tests:
nodejs ./test.js

install:
@mkdir -p ~/.node_libraries && cp ./build/default/hashlib.node ~/.node_libraries/hashlib.node
@mkdir -p ~/.node_libraries && cp ./build/Release/hashlib.node ~/.node_libraries/hashlib.node

all: build install

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -8,7 +8,7 @@
{ "name": "Seth Fitzsimmons", "email": "seth@mojodna.net" },
{ "name": "Wade Simmons", "email": "wade@wades.im" }
],
"main": "build/default/hashlib",
"main": "build/Release/hashlib",
"directories": { "lib": "./build/default" },
"engines": { "node": ">= 0.2.0" }
}
2 changes: 1 addition & 1 deletion test.js
@@ -1,4 +1,4 @@
var hashlib = require("./build/default/hashlib");
var hashlib = require("./build/Release/hashlib");
var sys = require("sys");
var md5 = require("./test/md5");
var assert = require("assert");
Expand Down

1 comment on commit 68d97cf

@hipyhop
Copy link

@hipyhop hipyhop commented on 68d97cf Nov 9, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes for me, thanks a lot :)

Please sign in to comment.