diff options
author | Jisi Liu <jisi.liu@gmail.com> | 2016-03-31 15:17:40 -0700 |
---|---|---|
committer | Jisi Liu <jisi.liu@gmail.com> | 2016-03-31 15:17:40 -0700 |
commit | bc1f2e7e6e416aa3428817dd3e43e531e81b399d (patch) | |
tree | 0b12ca14c1102cd6db8102828407745cc437ff06 | |
parent | cbfd9d43c829c412fe53cf003c78f51c8a307240 (diff) | |
download | protobuf-bc1f2e7e6e416aa3428817dd3e43e531e81b399d.tar.gz protobuf-bc1f2e7e6e416aa3428817dd3e43e531e81b399d.tar.bz2 protobuf-bc1f2e7e6e416aa3428817dd3e43e531e81b399d.zip |
Fix WIN32 build for map_test.
stubs/common.h undefines the GetMessage macro introduced in windows.h
map_test however include stubs/common.h before windows.h is transitively
included. This hack force map_test.cc to include windows.h first, so we
have a chance to undefine the GetMessage macro.
-rw-r--r-- | src/google/protobuf/map_test.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/google/protobuf/map_test.cc b/src/google/protobuf/map_test.cc index cda713f0..cfb3d001 100644 --- a/src/google/protobuf/map_test.cc +++ b/src/google/protobuf/map_test.cc @@ -28,6 +28,12 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// A hack to include windows.h first, which ensures the GetMessage macro can +// be undefined when we include <google/protobuf/stubs/common.h> +#if defined(_WIN32) +#include <windows.h> +#endif // _WIN32 + #include <algorithm> #include <google/protobuf/stubs/hash.h> #include <map> |