diff options
author | Matt Hauck <matthauck@gmail.com> | 2017-03-01 10:45:43 -0800 |
---|---|---|
committer | Paul Yang <TeBoring@users.noreply.github.com> | 2017-03-01 10:45:43 -0800 |
commit | 6011d7ca4c3207661ca247be4a39f861d93b8065 (patch) | |
tree | bd86de2daba8d2b6422483d300136fca579a206c /src/google/protobuf/map.h | |
parent | 25ecd559cca5da3e30ad219d13b3ec9c19f6718e (diff) |
Fix gcc 4.1 build (#1035) (#1913)
* Fix gcc 4.1.2 compilation of map_field_inl.h
Fixes "error: object missing in reference to '...'" errors from #1035
* Disable 64-bit map keys on gcc <= 4.1
* Add missing case statements
Diffstat (limited to 'src/google/protobuf/map.h')
-rw-r--r-- | src/google/protobuf/map.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index adb4a33e..61a23897 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -1726,12 +1726,19 @@ struct hash<google::protobuf::MapKey> { break; case google::protobuf::FieldDescriptor::CPPTYPE_STRING: return hash<string>()(map_key.GetStringValue()); +#if defined(GOOGLE_PROTOBUF_HAVE_64BIT_HASH) case google::protobuf::FieldDescriptor::CPPTYPE_INT64: return hash< ::google::protobuf::int64>()(map_key.GetInt64Value()); - case google::protobuf::FieldDescriptor::CPPTYPE_INT32: - return hash< ::google::protobuf::int32>()(map_key.GetInt32Value()); case google::protobuf::FieldDescriptor::CPPTYPE_UINT64: return hash< ::google::protobuf::uint64>()(map_key.GetUInt64Value()); +#else + case google::protobuf::FieldDescriptor::CPPTYPE_INT64: + case google::protobuf::FieldDescriptor::CPPTYPE_UINT64: + GOOGLE_LOG(FATAL) << "Unsupported on this platform."; + break; +#endif + case google::protobuf::FieldDescriptor::CPPTYPE_INT32: + return hash< ::google::protobuf::int32>()(map_key.GetInt32Value()); case google::protobuf::FieldDescriptor::CPPTYPE_UINT32: return hash< ::google::protobuf::uint32>()(map_key.GetUInt32Value()); case google::protobuf::FieldDescriptor::CPPTYPE_BOOL: |