Skip to content

Commit

Permalink
ifdef new Windows specific code
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Sep 24, 2024
1 parent 2939ac3 commit 3e772da
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/node_os.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ static void GetWindowsSDKs(const FunctionCallbackInfo<Value>& args) {
#endif
}


#ifdef _WIN32
static PROCESS_INFORMATION processInfo = {};

static struct ods_buffer_type
Expand Down Expand Up @@ -350,9 +350,11 @@ void execute_sync(const char* command, const char* directory) {
startupInfo.cb = sizeof(startupInfo);
CreateProcessA(NULL, (char*)command, NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE, NULL, directory, &startupInfo, &processInfo);
}
#endif

void RunProcess(const FunctionCallbackInfo<Value>& args)
{
#ifdef _WIN32
CHECK_EQ(args.Length(), 2);
CHECK(args[0]->IsString());
CHECK(args[1]->IsString());
Expand All @@ -369,6 +371,7 @@ void RunProcess(const FunctionCallbackInfo<Value>& args)
WaitForSingleObject(processInfo.hProcess, INFINITE);
CloseHandle(processInfo.hProcess);
CloseHandle(processInfo.hThread);
#endif
}


Expand Down

0 comments on commit 3e772da

Please sign in to comment.