Skip to content
Permalink
Browse files

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>
  • Loading branch information...
mhdawson authored and addaleax committed Jan 2, 2019
1 parent 379260e commit 465d02b817c1a827d97e49bacf142c5eec987a02
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/js_native_api.h
@@ -5,10 +5,11 @@
#include <stdbool.h>
#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

0 comments on commit 465d02b

Please sign in to comment.
You can’t perform that action at this time.