Skip to content

Commit 85ee01c

Browse files
addaleaxnodejs-github-bot
authored andcommitted
src: move napi_addon_register_func to node_api_types.h
This means that `node.h` can include only this file, instead of the entirety of `node_api.h`. Split out from #60496 since it was rightfully pointed out that the breaking part of the change should not touch Node-API headers. PR-URL: #60512 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 2595dd5 commit 85ee01c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/node_api.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ struct uv_loop_s; // Forward declaration.
3333
#define NAPI_NO_RETURN
3434
#endif
3535

36-
typedef napi_value(NAPI_CDECL* napi_addon_register_func)(napi_env env,
37-
napi_value exports);
38-
typedef int32_t(NAPI_CDECL* node_api_addon_get_api_version_func)(void);
39-
4036
// Used by deprecated registration method napi_module_register.
4137
typedef struct napi_module {
4238
int nm_version;

src/node_api_types.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
#include "js_native_api_types.h"
55

6+
typedef napi_value(NAPI_CDECL* napi_addon_register_func)(napi_env env,
7+
napi_value exports);
8+
typedef int32_t(NAPI_CDECL* node_api_addon_get_api_version_func)(void);
9+
610
typedef struct napi_callback_scope__* napi_callback_scope;
711
typedef struct napi_async_context__* napi_async_context;
812
typedef struct napi_async_work__* napi_async_work;

0 commit comments

Comments
 (0)