From 38762100ff1d224e340536b5cfbc8b5f1c10f179 Mon Sep 17 00:00:00 2001 From: Sergey Chernyshev Date: Thu, 25 Apr 2024 04:21:11 +0200 Subject: [PATCH] node-api: fix compiler warning in node_api.h Fix "-Wstrict-prototypes" warning from AppleClang 14.0.3.14030022, compiling C, targeting arch arm64 (on x86_64 host). I build my C addon with -Werror and recent changes to node_api.h broke our build. PR-URL: https://github.com/nodejs/node/pull/49103 Reviewed-By: Michael Dawson Reviewed-By: Gabriel Schulhof Reviewed-By: Chengzhong Wu --- graal-nodejs/src/node_api.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graal-nodejs/src/node_api.h b/graal-nodejs/src/node_api.h index 03454683c40..27acc6a0df4 100644 --- a/graal-nodejs/src/node_api.h +++ b/graal-nodejs/src/node_api.h @@ -30,7 +30,7 @@ struct uv_loop_s; // Forward declaration. 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)(); +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 { @@ -66,7 +66,7 @@ typedef struct napi_module { #define NAPI_MODULE_INIT() \ EXTERN_C_START \ - NAPI_MODULE_EXPORT int32_t NODE_API_MODULE_GET_API_VERSION() { \ + NAPI_MODULE_EXPORT int32_t NODE_API_MODULE_GET_API_VERSION(void) { \ return NAPI_VERSION; \ } \ NAPI_MODULE_EXPORT napi_value NAPI_MODULE_INITIALIZER(napi_env env, \