Skip to content

Commit

Permalink
fix for node v0.10.25 on Ubuntu 14.04
Browse files Browse the repository at this point in the history
Should work elsewhere too as `extern "C"` is not used in the
node documentation for writing add-ons anymore.
  • Loading branch information
pskocik authored and laverdet committed May 28, 2015
1 parent 84b5f7c commit 68da69d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/fibers.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "coroutine.h"
#include <assert.h>
#include <node.h>
#include <node_version.h>

#include <vector>

Expand Down Expand Up @@ -790,7 +791,10 @@ vector<Fiber*> Fiber::orphaned_fibers;
Persistent<Value> Fiber::fatal_stack;
bool did_init = false;

extern "C" void init(Handle<Object> target) {
#if !NODE_VERSION_AT_LEAST(0,10,0)
extern "C"
#endif
void init(Handle<Object> target) {
Isolate* isolate = Isolate::GetCurrent();
if (did_init || !target->Get(uni::NewLatin1Symbol(isolate, "Fiber"))->IsUndefined()) {
// Oh god. Node will call init() twice even though the library was loaded only once. See Node
Expand Down

0 comments on commit 68da69d

Please sign in to comment.