From 992c8ab4762123a49b5ec12fb4f03a67a4750f8a Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Wed, 2 Jan 2019 16:27:17 -0500 Subject: [PATCH] src: add NAPI_VERSION_EXPERIMENTAL Refs: https://github.com/nodejs/node-addon-api/issues/421 Define NAPI_VERSION_EXPERIMENTAL so that it can be used to guard code in addons that need to check if a function they want to use is available. PR-URL: https://github.com/nodejs/node/pull/25319 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- src/js_native_api.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js_native_api.h b/src/js_native_api.h index 01707d78cca..60f209f9482 100644 --- a/src/js_native_api.h +++ b/src/js_native_api.h @@ -5,10 +5,11 @@ #include #include "js_native_api_types.h" +// Use INT_MAX, this should only be consumed by the pre-processor anyway. +#define NAPI_VERSION_EXPERIMENTAL 2147483647 #ifndef NAPI_VERSION #ifdef NAPI_EXPERIMENTAL -// Use INT_MAX, this should only be consumed by the pre-processor anyway. -#define NAPI_VERSION 2147483647 +#define NAPI_VERSION NAPI_VERSION_EXPERIMENTAL #else // The baseline version for N-API #define NAPI_VERSION 3