From c91e1fe82b09ae0758ce6f0cb2edaf87bb82f80c Mon Sep 17 00:00:00 2001 From: "kenton@google.com" Date: Mon, 12 Oct 2009 19:22:03 +0000 Subject: [PATCH] Support MSVC 2010 beta 1. --- src/google/protobuf/stubs/strutil.cc | 1 + vsprojects/config.h | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/google/protobuf/stubs/strutil.cc b/src/google/protobuf/stubs/strutil.cc index 32b0f031a4..76d9d21ec4 100644 --- a/src/google/protobuf/stubs/strutil.cc +++ b/src/google/protobuf/stubs/strutil.cc @@ -36,6 +36,7 @@ #include #include #include +#include #ifdef _WIN32 // MSVC has only _snprintf, not snprintf. diff --git a/vsprojects/config.h b/vsprojects/config.h index e09f297e56..1becfc96db 100644 --- a/vsprojects/config.h +++ b/vsprojects/config.h @@ -5,7 +5,11 @@ #define HASH_MAP_H /* the namespace of hash_map/hash_set */ -#if _MSC_VER < 1310 +// Apparently Microsoft decided to move hash_map *back* to the std namespace +// in MSVC 2010: +// http://blogs.msdn.com/vcblog/archive/2009/05/25/stl-breaking-changes-in-visual-studio-2010-beta-1.aspx +// TODO(kenton): Use unordered_map instead, which is available in MSVC 2010. +#if _MSC_VER < 1310 || _MSC_VER >= 1500 #define HASH_NAMESPACE std #else #define HASH_NAMESPACE stdext