11#ifdef NDEBUG
22#undef NDEBUG
33#endif
4- #include " node.h"
5- #include " uv.h"
64#include < assert.h>
5+ #include " executable_wrapper.h"
6+ #include " node.h"
77
88#include < algorithm>
99
@@ -27,8 +27,10 @@ static int RunNodeInstance(MultiIsolatePlatform* platform,
2727 const std::vector<std::string>& args,
2828 const std::vector<std::string>& exec_args);
2929
30- int main (int argc, char ** argv) {
31- argv = uv_setup_args (argc, argv);
30+ NODE_MAIN (int argc, node::argv_type raw_argv[]) {
31+ char ** argv = nullptr ;
32+ node::FixupMain (argc, raw_argv, &argv);
33+
3234 std::vector<std::string> args (argv, argv + argc);
3335 std::shared_ptr<node::InitializationResult> result =
3436 node::InitializeOncePerProcess (
@@ -106,7 +108,7 @@ int RunNodeInstance(MultiIsolatePlatform* platform,
106108 }
107109
108110 if (!snapshot_blob_path.empty () && !is_building_snapshot) {
109- FILE* fp = fopen (snapshot_blob_path.c_str (), " r " );
111+ FILE* fp = fopen (snapshot_blob_path.c_str (), " rb " );
110112 assert (fp != nullptr );
111113 if (snapshot_as_file) {
112114 snapshot = node::EmbedderSnapshotData::FromFile (fp);
@@ -204,7 +206,7 @@ int RunNodeInstance(MultiIsolatePlatform* platform,
204206 snapshot = setup->CreateSnapshot ();
205207 assert (snapshot);
206208
207- FILE* fp = fopen (snapshot_blob_path.c_str (), " w " );
209+ FILE* fp = fopen (snapshot_blob_path.c_str (), " wb " );
208210 assert (fp != nullptr );
209211 if (snapshot_as_file) {
210212 snapshot->ToFile (fp);
0 commit comments