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

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

@googlebot I signed it!

@acozzette
Copy link
Member

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

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
@acozzette
Copy link
Member

Thanks, @giannitedesco.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants