aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/message.h
diff options
context:
space:
mode:
authorGravatar kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-04-22 20:06:20 +0000
committerGravatar kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-04-22 20:06:20 +0000
commit709ea28f3264aa5632e5577a4080671173fc6166 (patch)
treeebb91c2bdf45990cec0829ecf137eef69e130666 /src/google/protobuf/message.h
parent6f9bc71ffdf84d7cb0288112970659a94a2f13ae (diff)
Work around windows.h #defining GetMessage().
Diffstat (limited to 'src/google/protobuf/message.h')
-rw-r--r--src/google/protobuf/message.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/google/protobuf/message.h b/src/google/protobuf/message.h
index 0674a12c..b4209026 100644
--- a/src/google/protobuf/message.h
+++ b/src/google/protobuf/message.h
@@ -117,6 +117,24 @@
#else
#include <iosfwd>
#endif
+
+#if defined(_WIN32) && defined(GetMessage)
+// windows.h defines GetMessage() as a macro. Let's re-define it as an inline
+// function. This is necessary because Reflection has a method called
+// GetMessage() which we don't want overridden. 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
#include <google/protobuf/stubs/common.h>