Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Sep 13, 2011
1 parent 8c87250 commit cb6b9eb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
5 changes: 1 addition & 4 deletions node.gyp
Expand Up @@ -4,6 +4,7 @@
'target_arch': 'ia32',
'node_use_dtrace': 'false',
'node_use_openssl%': 'true',
'node_use_system_openssl%': 'false',
'library_files': [
'src/node.js',
'lib/_debugger.js',
Expand Down Expand Up @@ -51,10 +52,6 @@
],
},

'includes': [
'./options.gypi'
],

'targets': [
{
'target_name': 'node',
Expand Down
18 changes: 18 additions & 0 deletions src/node_stdio_win32.cc
Expand Up @@ -664,6 +664,23 @@ static Handle<Value> StopTTYWatcher(const Arguments& args) {
return Undefined();
}

// This exists to prevent process.stdout from keeping the event loop alive.
// It is only ever called in src/node.js during the initalization of
// process.stdout and will fail if called more than once. We do not want to
// expose uv_ref and uv_unref to javascript in general.
// This should be removed in the future!
static bool unref_called = false;
static Handle<Value> Unref(const Arguments& args) {
HandleScope scope;

assert(unref_called == false);

//uv_unref(uv_default_loop());
unref_called = true;

return Null();
}


void Stdio::Initialize(v8::Handle<v8::Object> target) {
init_scancode_table();
Expand Down Expand Up @@ -701,6 +718,7 @@ void Stdio::Initialize(v8::Handle<v8::Object> target) {
NODE_SET_METHOD(target, "destroyTTYWatcher", DestroyTTYWatcher);
NODE_SET_METHOD(target, "startTTYWatcher", StartTTYWatcher);
NODE_SET_METHOD(target, "stopTTYWatcher", StopTTYWatcher);
NODE_SET_METHOD(target, "unref", Unref);
}


Expand Down

0 comments on commit cb6b9eb

Please sign in to comment.