Skip to content

Commit

Permalink
Fix node v0.2.x compatibility
Browse files Browse the repository at this point in the history
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
laverdet committed Feb 3, 2011
1 parent 58e948c commit b11362b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions fibers.js
@@ -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 ' +
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/platform.mk
Expand Up @@ -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
Expand Down

0 comments on commit b11362b

Please sign in to comment.