aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/subprocess.cc
diff options
context:
space:
mode:
authorGravatar kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2010-01-15 02:28:48 +0000
committerGravatar kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2010-01-15 02:28:48 +0000
commit529a843f2d4a43dbe6505098108697f30cb1d777 (patch)
treec6148e19ad06ddb0c5962049522daf8ad4e11183 /src/google/protobuf/compiler/subprocess.cc
parentc25f833baf967e5ddae2e63ec453c84a3cb1cfd6 (diff)
Fix issues with Windows build: Always use ASCII version of CreateProcess (even if UNICODE is defined) and move GetMessage macro work-around to common.h so that it covers extension_set.h as well. Patch from Nick Carter.
Diffstat (limited to 'src/google/protobuf/compiler/subprocess.cc')
-rw-r--r--src/google/protobuf/compiler/subprocess.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/google/protobuf/compiler/subprocess.cc b/src/google/protobuf/compiler/subprocess.cc
index de46a3e6..913a1a46 100644
--- a/src/google/protobuf/compiler/subprocess.cc
+++ b/src/google/protobuf/compiler/subprocess.cc
@@ -96,7 +96,7 @@ void Subprocess::Start(const string& program, SearchMode search_mode) {
}
// Setup STARTUPINFO to redirect handles.
- STARTUPINFO startup_info;
+ STARTUPINFOA startup_info;
ZeroMemory(&startup_info, sizeof(startup_info));
startup_info.cb = sizeof(startup_info);
startup_info.dwFlags = STARTF_USESTDHANDLES;
@@ -115,16 +115,16 @@ void Subprocess::Start(const string& program, SearchMode search_mode) {
// Create the process.
PROCESS_INFORMATION process_info;
- if (CreateProcess((search_mode == SEARCH_PATH) ? NULL : program.c_str(),
- (search_mode == SEARCH_PATH) ? name_copy : NULL,
- NULL, // process security attributes
- NULL, // thread security attributes
- TRUE, // inherit handles?
- 0, // obscure creation flags
- NULL, // environment (inherit from parent)
- NULL, // current directory (inherit from parent)
- &startup_info,
- &process_info)) {
+ if (CreateProcessA((search_mode == SEARCH_PATH) ? NULL : program.c_str(),
+ (search_mode == SEARCH_PATH) ? name_copy : NULL,
+ NULL, // process security attributes
+ NULL, // thread security attributes
+ TRUE, // inherit handles?
+ 0, // obscure creation flags
+ NULL, // environment (inherit from parent)
+ NULL, // current directory (inherit from parent)
+ &startup_info,
+ &process_info)) {
child_handle_ = process_info.hProcess;
CloseHandleOrDie(process_info.hThread);
child_stdin_ = stdin_pipe_write;