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

Don't include sys/param.h for _BYTE_ORDER #8106

Merged
merged 1 commit into from Dec 2, 2020

Conversation

giannitedesco
Copy link
Contributor

@giannitedesco giannitedesco commented Nov 30, 2020

It includes a bunch of other files including a lot of macros which can
reduce the namespace available for actual protobuf.

For example, create a protobuf with a member called SIGSEGV. Since
macros cannot be namespaced in C++ this results in code which cannot be
compiled.

Fix this by just directly including endian.h

@google-cla
Copy link

google-cla bot commented Nov 30, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). 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 (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Nov 30, 2020
@giannitedesco
Copy link
Contributor Author

giannitedesco commented Nov 30, 2020

@googlebot I signed it!

@google-cla google-cla bot added cla: yes and removed cla: no labels Nov 30, 2020
@acozzette acozzette added release notes: yes Include this PR description in the next release c++ kokoro:run labels Nov 30, 2020
@acozzette
Copy link
Member

acozzette commented Nov 30, 2020

It looks like this endian.h header doesn't exist on Mac OS unfortunately.

It includes a bunch of other files including a lot of macros which can
reduce the namespace available for actual protobuf.

For example, create a protobuf with a member called SIGSEGV. Since
macros cannot be namespaced in C++ this results in code which cannot be
compiled.

Fix this by just directly including endian.h
@giannitedesco
Copy link
Contributor Author

giannitedesco commented Dec 2, 2020

Ah thanks. Apparently machine/endian.h is the thing to include on apple implementations.

@acozzette acozzette merged commit a91adf1 into protocolbuffers:master Dec 2, 2020
54 checks passed
@acozzette
Copy link
Member

acozzette commented Dec 2, 2020

Thanks, @giannitedesco.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ cla: yes release notes: yes Include this PR description in the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants