Permalink
Browse files

Fix node v0.2.x compatibility

require.resolve is a new feature. v0.3.x is going stable soon, after
which support for v0.2.x will dwindle. This also fixes 32-bit building
on some platforms.

Closes gh-7
  • Loading branch information...
1 parent 58e948c commit b11362bae3ecfa842b6cca0110d178d768e3f7f7 @laverdet committed Feb 3, 2011
Showing with 7 additions and 4 deletions.
  1. +3 −3 fibers.js
  2. +1 −1 package.json
  3. +3 −0 src/platform.mk
View
@@ -1,12 +1,12 @@
var fs = require('fs');
if (fs.statSync(process.execPath).mtime >
- fs.statSync(require.resolve('./src/fibers')).mtime) {
+ fs.statSync(__dirname + '/src/fibers')).mtime) {
throw new Error(
'`node` has a newer mtime than `fiber`; it is possible your build is out of date. This ' +
'could happen if you upgrade node. Try `npm rebuild fibers` to rebuild. If that doesn\'t ' +
- 'work you could consider running `touch ' + require.resolve('./src/fibers') + '` and maybe ' +
- 'there won\'t be a problem.');
+ 'work you could consider running `touch ' + __dirname + 'src/fibers` and maybe there won\'t ' +
+ 'be a problem.');
} else if (!process.env.FIBER_SHIM) {
throw new Error(
'Fiber support was not enabled when you ran node. To enable support for fibers, please run ' +
View
@@ -1,6 +1,6 @@
{
"name": "fibers",
- "version": "0.1.1",
+ "version": "0.1.3",
"description": "Cooperative multi-tasking for Javascript; or, the closest thing to a thread you'll see in node",
"keywords": ["fiber", "fibers", "coroutine", "thread", "async", "parallel", "worker"],
"homepage": "https://github.com/laverdet/node-fibers",
View
@@ -10,6 +10,9 @@ else
CPPFLAGS += -g -O3 -minline-all-stringops
endif
+ifeq ($(NODE_BITS), )
+ CPPFLAGS += -m32
+endif
ifeq ($(NODE_BITS), 32)
CPPFLAGS += -m32
endif

0 comments on commit b11362b

Please sign in to comment.