summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNickNaso <nicoladelgobbo@gmail.com>2019-05-23 11:57:31 +0200
committerMichaƫl Zasso <targos@protonmail.com>2019-07-02 11:46:59 +0200
commitcd71aad62bfcb83dfcc7b6267c6cc6e9bf49aa70 (patch)
treea136366cb033d4618f7ae99bd5ef867b447f92f5 /src
parent8a64b70efe9207f4eaad818780ab3088c91899fe (diff)
downloadandroid-node-v8-cd71aad62bfcb83dfcc7b6267c6cc6e9bf49aa70.tar.gz
android-node-v8-cd71aad62bfcb83dfcc7b6267c6cc6e9bf49aa70.tar.bz2
android-node-v8-cd71aad62bfcb83dfcc7b6267c6cc6e9bf49aa70.zip
build: expose napi_build_version variable
Expose `napi_build_version` to allow `node-gyp` to make it available for building native addons. Fixes: https://github.com/nodejs/node-gyp/issues/1745 Refs: https://github.com/nodejs/abi-stable-node/issues/371 PR-URL: https://github.com/nodejs/node/pull/27835 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/js_native_api.h7
-rw-r--r--src/node_version.h3
2 files changed, 8 insertions, 2 deletions
diff --git a/src/js_native_api.h b/src/js_native_api.h
index 0646a2d94c..4f9345a4ab 100644
--- a/src/js_native_api.h
+++ b/src/js_native_api.h
@@ -12,7 +12,12 @@
#ifdef NAPI_EXPERIMENTAL
#define NAPI_VERSION NAPI_VERSION_EXPERIMENTAL
#else
-// The baseline version for N-API
+// The baseline version for N-API.
+// The NAPI_VERSION controls which version will be used by default when
+// compilling a native addon. If the addon developer specifically wants to use
+// functions available in a new version of N-API that is not yet ported in all
+// LTS versions, they can set NAPI_VERSION knowing that they have specifically
+// depended on that version.
#define NAPI_VERSION 4
#endif
#endif
diff --git a/src/node_version.h b/src/node_version.h
index 97c136c719..eaabb46f78 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -91,7 +91,8 @@
*/
#define NODE_MODULE_VERSION 72
-// the NAPI_VERSION provided by this version of the runtime
+// The NAPI_VERSION provided by this version of the runtime. This is the version
+// which the Node binary being built supports.
#define NAPI_VERSION 4
#endif // SRC_NODE_VERSION_H_