Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
709ea28f
Commit
709ea28f
authored
Apr 22, 2009
by
kenton@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around windows.h #defining GetMessage().
parent
6f9bc71f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
message.h
src/google/protobuf/message.h
+18
-0
test_util.cc
src/google/protobuf/test_util.cc
+6
-0
googletest.h
src/google/protobuf/testing/googletest.h
+1
-0
No files found.
src/google/protobuf/message.h
View file @
709ea28f
...
...
@@ -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>
...
...
src/google/protobuf/test_util.cc
View file @
709ea28f
...
...
@@ -32,6 +32,12 @@
// Based on original Protocol Buffers design by
// Sanjay Ghemawat, Jeff Dean, and others.
#ifdef _WIN32
// Verify that #icnluding windows.h does not break anything (e.g. because
// windows.h #defines GetMessage() as a macro).
#include <windows.h>
#endif
#include <google/protobuf/test_util.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/message.h>
...
...
src/google/protobuf/testing/googletest.h
View file @
709ea28f
...
...
@@ -58,6 +58,7 @@ string GetCapturedTestStderr();
// For use with ScopedMemoryLog::GetMessages(). Inside Google the LogLevel
// constants don't have the LOGLEVEL_ prefix, so the code that used
// ScopedMemoryLog refers to LOGLEVEL_ERROR as just ERROR.
#undef ERROR // defend against promiscuous windows.h
static
const
LogLevel
ERROR
=
LOGLEVEL_ERROR
;
// Receives copies of all LOG(ERROR) messages while in scope. Sample usage:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment