From 018efcd8463f2348090951a13bd100265201d5d9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 12 Nov 2025 00:21:01 +0000 Subject: [PATCH] feat: update headers from nodejs/node tag v25.2.0 --- include/js_native_api.h | 14 +------------- include/js_native_api_types.h | 13 +++++++++++++ include/node_api.h | 4 ---- include/node_api_types.h | 4 ++++ 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/include/js_native_api.h b/include/js_native_api.h index fdd455a..8e91d6c 100644 --- a/include/js_native_api.h +++ b/include/js_native_api.h @@ -5,19 +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 -// 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 - - #include "js_native_api_types.h" // If you need __declspec(dllimport), either include instead, or @@ -63,6 +50,7 @@ NAPI_EXTERN napi_status NAPI_CDECL napi_get_boolean(napi_env env, // Methods to create Primitive types/Objects NAPI_EXTERN napi_status NAPI_CDECL napi_create_object(napi_env env, napi_value* result); + NAPI_EXTERN napi_status NAPI_CDECL napi_create_array(napi_env env, napi_value* result); NAPI_EXTERN napi_status NAPI_CDECL diff --git a/include/js_native_api_types.h b/include/js_native_api_types.h index 7853a8d..53ba308 100644 --- a/include/js_native_api_types.h +++ b/include/js_native_api_types.h @@ -1,6 +1,19 @@ #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 +// 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 + + // 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. diff --git a/include/node_api.h b/include/node_api.h index 35e5c3e..46dbb02 100644 --- a/include/node_api.h +++ b/include/node_api.h @@ -33,10 +33,6 @@ struct uv_loop_s; // Forward declaration. #define NAPI_NO_RETURN #endif -typedef napi_value(NAPI_CDECL* napi_addon_register_func)(napi_env env, - napi_value exports); -typedef int32_t(NAPI_CDECL* node_api_addon_get_api_version_func)(void); - // Used by deprecated registration method napi_module_register. typedef struct napi_module { int nm_version; diff --git a/include/node_api_types.h b/include/node_api_types.h index 9c2f03f..2580f15 100644 --- a/include/node_api_types.h +++ b/include/node_api_types.h @@ -3,6 +3,10 @@ #include "js_native_api_types.h" +typedef napi_value(NAPI_CDECL* napi_addon_register_func)(napi_env env, + napi_value exports); +typedef int32_t(NAPI_CDECL* node_api_addon_get_api_version_func)(void); + typedef struct napi_callback_scope__* napi_callback_scope; typedef struct napi_async_context__* napi_async_context; typedef struct napi_async_work__* napi_async_work;