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

Fix broken max macro on Windows #9273

Merged
merged 1 commit into from
Dec 14, 2021
Merged

Conversation

Kerisa
Copy link
Contributor

@Kerisa Kerisa commented Dec 2, 2021

Hi there,

I found that if I include the auto generated XX.pb.h in my code then the "max" macro defined by Windows will be broken.

And this is caused by a direct undef in src/google/protobuf/arena.h

#ifdef max
#undef max  // Visual Studio defines this macro
#endif

I think this should be done by using port_def.inc and port_undef.inc pairs so I removed this undef and add a protect on src/google/protobuf/stubs/stl_util.h.

Thank you

@Kerisa
Copy link
Contributor Author

Kerisa commented Dec 14, 2021

I have sign the Google Individual CLA agreement just now, is there any one who can help to trigger a rescan? Thanks.

@google-cla google-cla bot added cla: yes and removed cla: no labels Dec 14, 2021
@acozzette acozzette merged commit 8c29dc2 into protocolbuffers:master Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ cla: yes platform related Any issue releated to specific platform or OS windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants