File tree Expand file tree Collapse file tree 3 files changed +22
-17
lines changed Expand file tree Collapse file tree 3 files changed +22
-17
lines changed Original file line number Diff line number Diff line change 113
113
'src/node_debug.cc' ,
114
114
'src/node_dir.cc' ,
115
115
'src/node_dotenv.cc' ,
116
- 'src/node_env_var.cc' ,
117
116
'src/node_embedding_api.cc' ,
117
+ 'src/node_embedding_api.h' ,
118
+ 'src/node_env_var.cc' ,
118
119
'src/node_errors.cc' ,
119
120
'src/node_external_reference.cc' ,
120
121
'src/node_file.cc' ,
Original file line number Diff line number Diff line change 13
13
// C-based API.
14
14
//
15
15
16
+ #include " node_embedding_api.h"
16
17
#include " node.h"
17
18
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);
28
23
}
24
+
25
+ EXTERN_C_END
Original file line number Diff line number Diff line change 13
13
// C-based API.
14
14
//
15
15
16
- #include "node.h"
16
+ #ifndef SRC_NODE_EMBEDDING_API_H_
17
+ #define SRC_NODE_EMBEDDING_API_H_
17
18
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"
23
20
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