Skip to content

Commit df9cf52

Browse files
committed
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: nodejs/node#49103 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 90817a8 commit df9cf52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graal-nodejs/src/node_api.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct uv_loop_s; // Forward declaration.
3030

3131
typedef napi_value(NAPI_CDECL* napi_addon_register_func)(napi_env env,
3232
napi_value exports);
33-
typedef int32_t(NAPI_CDECL* node_api_addon_get_api_version_func)();
33+
typedef int32_t(NAPI_CDECL* node_api_addon_get_api_version_func)(void);
3434

3535
// Used by deprecated registration method napi_module_register.
3636
typedef struct napi_module {
@@ -66,7 +66,7 @@ typedef struct napi_module {
6666

6767
#define NAPI_MODULE_INIT() \
6868
EXTERN_C_START \
69-
NAPI_MODULE_EXPORT int32_t NODE_API_MODULE_GET_API_VERSION() { \
69+
NAPI_MODULE_EXPORT int32_t NODE_API_MODULE_GET_API_VERSION(void) { \
7070
return NAPI_VERSION; \
7171
} \
7272
NAPI_MODULE_EXPORT napi_value NAPI_MODULE_INITIALIZER(napi_env env, \

0 commit comments

Comments
 (0)