diff options
author | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2010-01-15 02:28:48 +0000 |
---|---|---|
committer | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2010-01-15 02:28:48 +0000 |
commit | 529a843f2d4a43dbe6505098108697f30cb1d777 (patch) | |
tree | c6148e19ad06ddb0c5962049522daf8ad4e11183 /src/google/protobuf/stubs/common.h | |
parent | c25f833baf967e5ddae2e63ec453c84a3cb1cfd6 (diff) | |
download | protobuf-529a843f2d4a43dbe6505098108697f30cb1d777.tar.gz protobuf-529a843f2d4a43dbe6505098108697f30cb1d777.tar.bz2 protobuf-529a843f2d4a43dbe6505098108697f30cb1d777.zip |
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/stubs/common.h')
-rw-r--r-- | src/google/protobuf/stubs/common.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h index b8d2ecb9..cdac37af 100644 --- a/src/google/protobuf/stubs/common.h +++ b/src/google/protobuf/stubs/common.h @@ -48,6 +48,24 @@ #include <stdint.h> #endif +#if defined(_WIN32) && defined(GetMessage) +// Allow GetMessage to be used as a valid method name in protobuf classes. +// windows.h defines GetMessage() as a macro. Let's re-define it as an inline +// function. The inline function should be equivalent for C++ users. +inline BOOL GetMessage_Win32( + LPMSG lpMsg, HWND hWnd, + UINT wMsgFilterMin, UINT wMsgFilterMax) { + return GetMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax); +} +#undef GetMessage +inline BOOL GetMessage( + LPMSG lpMsg, HWND hWnd, + UINT wMsgFilterMin, UINT wMsgFilterMax) { + return GetMessage_Win32(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax); +} +#endif + + namespace std {} namespace google { |