Fix gcc 4.1 build (#1035)#1913
Conversation
|
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok to test. |
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
This should fix #1035 |
|
CLAs look good, thanks! |
|
ping Is there anything missing here? Any changes requested? |
|
Can one of the admins verify this patch? |
|
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
Fixes "error: object missing in reference to '...'" errors from protocolbuffers#1035
|
Can you rebase this pull request on the current master? |
|
Just finished doing that and making sure it still built. :) |
|
ok to test. |
|
LGTM |
| #else | ||
| case google::protobuf::FieldDescriptor::CPPTYPE_INT64: | ||
| case google::protobuf::FieldDescriptor::CPPTYPE_UINT64: | ||
| GOOGLE_LOG(FATAL) << "Unsupported on this platform."; |
There was a problem hiding this comment.
This is not the right use of LOG(FATAL). Protobuf library should not crash an user's program given a valid input. If the platform can not be supported, it should be reported at compile time. Though, in this case it seems easy enough to write a custom hash function if it's not already available in the platform headers. @matthauck @TeBoring Do you plan to actually implement this hash for int64? I saw this change while working on integrating github changes to our internal repo and I'm going to leave this change out.
There was a problem hiding this comment.
Oh, whoops, sorry. 😞
The thought did not cross my mind to implement this on these platforms. I'd be open to helping out if you could give me some pointers on where to start.
There was a problem hiding this comment.
I guess just an empty implementation would be enough. It's better to trigger compile error if the hash for int64 is used.
There was a problem hiding this comment.
https://github.com/google/protobuf/blob/master/src/google/protobuf/stubs/hash.h#L184
Here is an example. For int64, how about just trimming?
Rather than crashing on use (doh!) better to just declare this platform is missing a proper hash_map/hash_set implementation and use the std::map/std::set emulation. Fixes regression introduced by protocolbuffers#1913
Rather than crashing on use (doh!) better to just implement the missing std::tr1::hash structs. Fixes regression introduced by protocolbuffers#1913
Rather than crashing on use (doh!) better to just declare this platform is missing a proper hash_map/hash_set implementation and use the std::map/std::set emulation. Fixes regression introduced by protocolbuffers#1913
Rather than crashing on use (doh!) better to just implement the missing std::tr1::hash structs. Fixes regression introduced by protocolbuffers#1913
Rather than crashing on use (doh!) better to just declare this platform is missing a proper hash_map/hash_set implementation and use the std::map/std::set emulation. Fixes regression introduced by #1913
No description provided.