瀏覽代碼

Fix Win32ErrorMessage on Unicode build

Wei-Yin Chen (陳威尹) 9 年之前
父節點
當前提交
48811b2edd
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      src/google/protobuf/compiler/subprocess.cc

+ 6 - 6
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);