From 76bfe10badf4cfe7d355e0f6df2a09916f259e4c Mon Sep 17 00:00:00 2001 From: John French Date: Mon, 8 Jan 2018 14:45:08 -0500 Subject: [PATCH] Fix build on versions between 8.0.0 and 8.6.0 There are conflicting definitions for node::async_id and node::async_context in Node.js 8.2. PR-URL: https://github.com/nodejs/node-addon-api/pull/209 Reviewed-By: Michael Dawson --- src/node_internals.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node_internals.h b/src/node_internals.h index 43744fa..7444fbd 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -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 resource, v8::Local name,