diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/google/protobuf/arena_unittest.cc | 2 | ||||
-rw-r--r-- | src/google/protobuf/compiler/objectivec/objectivec_field.cc | 6 | ||||
-rw-r--r-- | src/google/protobuf/lite_unittest.cc | 2 | ||||
-rw-r--r-- | src/google/protobuf/map.h | 6 | ||||
-rw-r--r-- | src/google/protobuf/map_field_test.cc | 2 | ||||
-rw-r--r-- | src/google/protobuf/map_test.cc | 2 | ||||
-rwxr-xr-x | src/google/protobuf/stubs/hash.h | 5 |
7 files changed, 14 insertions, 11 deletions
diff --git a/src/google/protobuf/arena_unittest.cc b/src/google/protobuf/arena_unittest.cc index 307c0905..6c185695 100644 --- a/src/google/protobuf/arena_unittest.cc +++ b/src/google/protobuf/arena_unittest.cc @@ -30,8 +30,6 @@ #include <google/protobuf/arena.h> -#include <stdint.h> - #include <algorithm> #include <cstring> #include <memory> diff --git a/src/google/protobuf/compiler/objectivec/objectivec_field.cc b/src/google/protobuf/compiler/objectivec/objectivec_field.cc index ee5253a5..c5f05653 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_field.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_field.cc @@ -256,7 +256,7 @@ void FieldGenerator::GenerateFieldDescription( // " .typeSpecific.value* = [something]," GenerateFieldDescriptionTypeSpecific(printer); - const string& field_options(variables_.at("fieldoptions")); + const string& field_options(variables_.find("fieldoptions")->second); if (field_options.empty()) { printer->Print(" .fieldOptions = NULL,\n"); } else { @@ -379,7 +379,7 @@ void ObjCObjFieldGenerator::GeneratePropertyDeclaration( printer->Print( variables_, "@property(nonatomic, readwrite, $property_storage_attribute$) $property_type$ *$name$$storage_attribute$;\n"); - if (IsInitName(variables_.at("name"))) { + if (IsInitName(variables_.find("name")->second)) { // If property name starts with init we need to annotate it to get past ARC. // http://stackoverflow.com/questions/18723226/how-do-i-annotate-an-objective-c-property-with-an-objc-method-family/18723227#18723227 printer->Print(variables_, @@ -426,7 +426,7 @@ void RepeatedFieldGenerator::GeneratePropertyDeclaration( "$comments$" "$array_comment$" "@property(nonatomic, readwrite, strong) $array_storage_type$ *$name$$storage_attribute$;\n"); - if (IsInitName(variables_.at("name"))) { + if (IsInitName(variables_.find("name")->second)) { // If property name starts with init we need to annotate it to get past ARC. // http://stackoverflow.com/questions/18723226/how-do-i-annotate-an-objective-c-property-with-an-objc-method-family/18723227#18723227 printer->Print(variables_, diff --git a/src/google/protobuf/lite_unittest.cc b/src/google/protobuf/lite_unittest.cc index 1995cf08..5af8b24d 100644 --- a/src/google/protobuf/lite_unittest.cc +++ b/src/google/protobuf/lite_unittest.cc @@ -700,7 +700,7 @@ int main(int argc, char* argv[]) { // Allocate a large initial block to avoid mallocs during hooked test. std::vector<char> arena_block(128 * 1024); google::protobuf::ArenaOptions options; - options.initial_block = arena_block.data(); + options.initial_block = &arena_block[0]; options.initial_block_size = arena_block.size(); google::protobuf::Arena arena(options); string data; diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index 58a1817a..c16fbed2 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -33,6 +33,7 @@ #include <iterator> #include <google/protobuf/stubs/hash.h> +#include <limits> // To support Visual Studio 2008 #include <google/protobuf/arena.h> #include <google/protobuf/generated_enum_util.h> @@ -200,6 +201,11 @@ class Map { return arena_ != other.arena_; } + // To support Visual Studio 2008 + size_type max_size() const { + return std::numeric_limits<size_type>::max(); + } + private: Arena* arena_; diff --git a/src/google/protobuf/map_field_test.cc b/src/google/protobuf/map_field_test.cc index f4681866..e3a64079 100644 --- a/src/google/protobuf/map_field_test.cc +++ b/src/google/protobuf/map_field_test.cc @@ -145,7 +145,7 @@ TEST_F(MapFieldBasePrimitiveTest, Arena) { // Allocate a large initial block to avoid mallocs during hooked test. std::vector<char> arena_block(128 * 1024); ArenaOptions options; - options.initial_block = arena_block.data(); + options.initial_block = &arena_block[0]; options.initial_block_size = arena_block.size(); Arena arena(options); diff --git a/src/google/protobuf/map_test.cc b/src/google/protobuf/map_test.cc index 447f52d9..d62ec85f 100644 --- a/src/google/protobuf/map_test.cc +++ b/src/google/protobuf/map_test.cc @@ -2285,7 +2285,7 @@ TEST(ArenaTest, ParsingAndSerializingNoHeapAllocation) { // Allocate a large initial block to avoid mallocs during hooked test. std::vector<char> arena_block(128 * 1024); ArenaOptions options; - options.initial_block = arena_block.data(); + options.initial_block = &arena_block[0]; options.initial_block_size = arena_block.size(); Arena arena(options); string data; diff --git a/src/google/protobuf/stubs/hash.h b/src/google/protobuf/stubs/hash.h index ee3c63fe..4da8a5d8 100755 --- a/src/google/protobuf/stubs/hash.h +++ b/src/google/protobuf/stubs/hash.h @@ -112,7 +112,7 @@ class hash_set : public std::set<Key, HashFcn> { #elif defined(_MSC_VER) && !defined(_STLPORT_VERSION) template <typename Key> -struct hash : public GOOGLE_PROTOBUF_HASH_NAMESPACE::hash_compare<Key> { +struct hash : public GOOGLE_PROTOBUF_HASH_COMPARE<Key> { }; // MSVC's hash_compare<const char*> hashes based on the string contents but @@ -126,8 +126,7 @@ class CstringLess { template <> struct hash<const char*> - : public GOOGLE_PROTOBUF_HASH_NAMESPACE::hash_compare< - const char*, CstringLess> {}; + : public GOOGLE_PROTOBUF_HASH_COMPARE<const char*, CstringLess> {}; template <typename Key, typename Data, typename HashFcn = hash<Key>, |