From 6011d7ca4c3207661ca247be4a39f861d93b8065 Mon Sep 17 00:00:00 2001 From: Matt Hauck Date: Wed, 1 Mar 2017 10:45:43 -0800 Subject: 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 --- src/google/protobuf/map.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/google/protobuf/map.h') 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 { break; case google::protobuf::FieldDescriptor::CPPTYPE_STRING: return hash()(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: -- cgit v1.2.3