Skip to content

Commit 465d02b

Browse files
mhdawsonaddaleax
authored andcommitted
src: add NAPI_VERSION_EXPERIMENTAL
Refs: nodejs/node-addon-api#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: #25319 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 379260e commit 465d02b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/js_native_api.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
#include <stdbool.h>
66
#include "js_native_api_types.h"
77

8+
// Use INT_MAX, this should only be consumed by the pre-processor anyway.
9+
#define NAPI_VERSION_EXPERIMENTAL 2147483647
810
#ifndef NAPI_VERSION
911
#ifdef NAPI_EXPERIMENTAL
10-
// Use INT_MAX, this should only be consumed by the pre-processor anyway.
11-
#define NAPI_VERSION 2147483647
12+
#define NAPI_VERSION NAPI_VERSION_EXPERIMENTAL
1213
#else
1314
// The baseline version for N-API
1415
#define NAPI_VERSION 3

0 commit comments

Comments
 (0)