aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Wei-Yin Chen (陳威尹) <wychen@chromium.org>2016-08-19 16:41:55 -0700
committerGravatar Wei-Yin Chen (陳威尹) <wychen@chromium.org>2016-08-31 17:28:51 -0700
commit48811b2eddadf723b0685934025735163c74362f (patch)
tree8e933982d6d886d95d3afa9fda1fcb7fe332ff9e
parent11d6cb56d0df8427dd1a768d39a9717c2c4a7e70 (diff)
Fix Win32ErrorMessage on Unicode build
-rw-r--r--src/google/protobuf/compiler/subprocess.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/google/protobuf/compiler/subprocess.cc b/src/google/protobuf/compiler/subprocess.cc
index 6e258664..e929e4fb 100644
--- a/src/google/protobuf/compiler/subprocess.cc
+++ b/src/google/protobuf/compiler/subprocess.cc
@@ -261,12 +261,12 @@ string Subprocess::Win32ErrorMessage(DWORD error_code) {
char* message;
// WTF?
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL, error_code, 0,
- (LPTSTR)&message, // NOT A BUG!
- 0, NULL);
+ FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, error_code, 0,
+ (LPSTR)&message, // NOT A BUG!
+ 0, NULL);
string result = message;
LocalFree(message);