Skip to content

Commit

Permalink
Wide chars are used only when UNICODE is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
StableAgOH authored and benman64 committed Aug 24, 2024
1 parent e78ee88 commit 1abb018
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/cpp/subprocess/ProcessBuilder_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ namespace subprocess {

process.cwd = this->cwd;
// Create the child process.
#if _WIN64 && !defined(__MINGW32__)
#ifdef UNICODE // CreateProcessW
std::u16string cmd_args{ utf8_to_utf16(args) };
bSuccess = CreateProcess(
(LPCWSTR)utf8_to_utf16(program).c_str(),
Expand All @@ -144,7 +144,7 @@ namespace subprocess {
(LPCWSTR)(this->cwd.empty() ? nullptr : utf8_to_utf16(this->cwd).c_str()), // use parent's current directory
&siStartInfo, // STARTUPINFO pointer
&process.process_info); // receives PROCESS_INFORMATION
#else
#else // CreateProcessA
std::string cmd_args{ args };
bSuccess = CreateProcess(
(LPCSTR)program.c_str(),
Expand Down Expand Up @@ -183,8 +183,6 @@ namespace subprocess {
throw SpawnError("CreateProcess failed");
return process;
}


}

#endif

0 comments on commit 1abb018

Please sign in to comment.