Skip to content

Commit

Permalink
src: add NAPI_VERSION_EXPERIMENTAL
Browse files Browse the repository at this point in the history
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 5, 2019
1 parent 379260e commit 465d02b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/js_native_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 465d02b

Please sign in to comment.