diff --git a/src/js_native_api.h b/src/js_native_api.h index 95b220cba1b..f979720b0ca 100644 --- a/src/js_native_api.h +++ b/src/js_native_api.h @@ -5,22 +5,6 @@ #include // NOLINT(modernize-deprecated-headers) #include // NOLINT(modernize-deprecated-headers) -// Use INT_MAX, this should only be consumed by the pre-processor anyway. -#define NAPI_VERSION_EXPERIMENTAL 2147483647 -#ifndef NAPI_VERSION -#ifdef NAPI_EXPERIMENTAL -#define NAPI_VERSION NAPI_VERSION_EXPERIMENTAL -#else -// 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 8 -#endif -#endif - #include "js_native_api_types.h" // If you need __declspec(dllimport), either include instead, or diff --git a/src/js_native_api_types.h b/src/js_native_api_types.h index 43e7bb77ff9..e79a360d439 100644 --- a/src/js_native_api_types.h +++ b/src/js_native_api_types.h @@ -1,6 +1,22 @@ #ifndef SRC_JS_NATIVE_API_TYPES_H_ #define SRC_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 +#define NAPI_VERSION NAPI_VERSION_EXPERIMENTAL +#else +// 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 8 +#endif +#endif + // This file needs to be compatible with C compilers. // This is a public include file, and these includes have essentially // became part of it's API.