File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 113113 'src/node_debug.cc' ,
114114 'src/node_dir.cc' ,
115115 'src/node_dotenv.cc' ,
116- 'src/node_env_var.cc' ,
117116 'src/node_embedding_api.cc' ,
117+ 'src/node_embedding_api.h' ,
118+ 'src/node_env_var.cc' ,
118119 'src/node_errors.cc' ,
119120 'src/node_external_reference.cc' ,
120121 'src/node_file.cc' ,
Original file line number Diff line number Diff line change 1313// C-based API.
1414//
1515
16+ #include " node_embedding_api.h"
1617#include " node.h"
1718
18- extern " C" {
19- #ifdef _WIN32
20- __declspec (dllexport) int node_embedding_start(int argc, char ** argv) {
21- return node::Start (argc, argv);
22- }
23- #else
24- int node_embedding_start (int argc, char ** argv) {
25- return node::Start (argc, argv);
26- }
27- #endif
19+ EXTERN_C_START
20+
21+ int32_t NAPI_CDECL node_embedding_main (int32_t argc, char * argv[]) {
22+ return node::Start (argc, argv);
2823}
24+
25+ EXTERN_C_END
Original file line number Diff line number Diff line change 1313// C-based API.
1414//
1515
16- #include "node.h"
16+ #ifndef SRC_NODE_EMBEDDING_API_H_
17+ #define SRC_NODE_EMBEDDING_API_H_
1718
18- #ifdef _WIN32
19- int __cdecl node_embedding_start (int argc , char * * argv );
20- #else
21- int node_embedding_start (int argc , char * * argv );
22- #endif
19+ #include "node_api.h"
2320
21+ #define NODE_EMBEDDING_VERSION 1
22+
23+ EXTERN_C_START
24+
25+ // Runs Node.js main function. It is the same as running Node.js from CLI.
26+ NAPI_EXTERN int32_t NAPI_CDECL node_embedding_main (int32_t argc , char * argv []);
27+
28+ EXTERN_C_END
29+
30+ #endif // SRC_NODE_EMBEDDING_API_H_
You can’t perform that action at this time.
0 commit comments