OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 return false; | 254 return false; |
255 } | 255 } |
256 | 256 |
257 return true; | 257 return true; |
258 } | 258 } |
259 | 259 |
260 string Subprocess::Win32ErrorMessage(DWORD error_code) { | 260 string Subprocess::Win32ErrorMessage(DWORD error_code) { |
261 char* message; | 261 char* message; |
262 | 262 |
263 // WTF? | 263 // WTF? |
264 FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | | 264 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | |
265 FORMAT_MESSAGE_IGNORE_INSERTS, | 265 FORMAT_MESSAGE_FROM_SYSTEM | |
266 NULL, error_code, 0, | 266 FORMAT_MESSAGE_IGNORE_INSERTS, |
267 (LPSTR)&message, // NOT A BUG! | 267 NULL, error_code, 0, |
268 0, NULL); | 268 (LPTSTR)&message, // NOT A BUG! |
| 269 0, NULL); |
269 | 270 |
270 string result = message; | 271 string result = message; |
271 LocalFree(message); | 272 LocalFree(message); |
272 return result; | 273 return result; |
273 } | 274 } |
274 | 275 |
275 // =================================================================== | 276 // =================================================================== |
276 | 277 |
277 #else // _WIN32 | 278 #else // _WIN32 |
278 | 279 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 } | 456 } |
456 | 457 |
457 return true; | 458 return true; |
458 } | 459 } |
459 | 460 |
460 #endif // !_WIN32 | 461 #endif // !_WIN32 |
461 | 462 |
462 } // namespace compiler | 463 } // namespace compiler |
463 } // namespace protobuf | 464 } // namespace protobuf |
464 } // namespace google | 465 } // namespace google |
OLD | NEW |