Skip to content
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

Merged
merged 2 commits into from
Jul 29, 2015
Merged

On x64 MSVC platform, macro PROTOBUF_LITTLE_ENDIAN won't be set #651

merged 2 commits into from
Jul 29, 2015

Conversation

LitingLin
Copy link
Contributor

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

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jul 29, 2015

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

@googlebot
Copy link

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. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@LitingLin
Copy link
Contributor Author

_M_AMD64 will be defined on AMD64 platform and won't be defined on IA64 or ARM.
I think this is a perfect solution.

@LitingLin
Copy link
Contributor Author

Okay, I signed it!

@googlebot
Copy link

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)) && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, updated. Thanks

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jul 29, 2015

Thanks!

xfxyjwf added a commit that referenced this pull request Jul 29, 2015
On x64 MSVC platform, macro PROTOBUF_LITTLE_ENDIAN won't be set
@xfxyjwf xfxyjwf merged commit add3e8d into protocolbuffers:master Jul 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants