Skip to content

Commit

Permalink
Fix build on versions between 8.0.0 and 8.6.0
Browse files Browse the repository at this point in the history
There are conflicting definitions for node::async_id and
node::async_context in Node.js 8.2.

PR-URL: nodejs/node-addon-api#209
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
wroy7860 committed Jan 10, 2018
1 parent 82784c7 commit 8b8416e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/node_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ class CallbackScope {

namespace node {

#if NODE_MAJOR_VERSION < 8 || NODE_MAJOR_VERSION == 8 && NODE_MINOR_VERSION < 6
#if NODE_MAJOR_VERSION < 8 || NODE_MAJOR_VERSION == 8 && NODE_MINOR_VERSION < 2
typedef int async_id;

typedef struct async_context {
node::async_id async_id;
node::async_id trigger_async_id;
} async_context;
#endif // NODE_MAJOR_VERSION < 8.2

#if NODE_MAJOR_VERSION < 8 || NODE_MAJOR_VERSION == 8 && NODE_MINOR_VERSION < 6
NODE_EXTERN async_context EmitAsyncInit(v8::Isolate* isolate,
v8::Local<v8::Object> resource,
v8::Local<v8::String> name,
Expand Down

0 comments on commit 8b8416e

Please sign in to comment.