-
Notifications
You must be signed in to change notification settings - Fork 15.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On x64 MSVC platform, macro PROTOBUF_LITTLE_ENDIAN won't be set #651
Conversation
I'm pretty sure it's a bug. The code in io/coded_stream.h should be updated (or just removed) in favor of the definition in port.h: https://github.com/google/protobuf/blob/master/src/google/protobuf/stubs/port.h#L49 |
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case 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.
|
_M_AMD64 will be defined on AMD64 platform and won't be defined on IA64 or ARM. |
Okay, I signed it! |
CLAs look good, thanks! |
@@ -112,7 +112,7 @@ | |||
#include <string> | |||
#include <utility> | |||
#ifdef _MSC_VER | |||
#if defined(_M_IX86) && \ | |||
#if (defined(_M_IX86) || defined(_M_AMD64)) && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update this to be the same as in port.h:
https://github.com/google/protobuf/blob/master/src/google/protobuf/stubs/port.h#L49
From what I gathered, windows always uses little-endian:
http://stackoverflow.com/questions/6449468/can-i-safely-assume-that-windows-installations-will-always-be-little-endian
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, updated. Thanks
Thanks! |
On x64 MSVC platform, macro PROTOBUF_LITTLE_ENDIAN won't be set
Is this intentional?
The cause is that _M_IX86 is undefined when target x64 processor.
The relative code is in File io/coded_stream.h, Line 115