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

Guard against min/max being macros in a cross-compiler way #1057

Merged
merged 2 commits into from
Sep 6, 2017

Conversation

chwarr
Copy link
Contributor

@chwarr chwarr commented Sep 6, 2017

Guards against min/max being macros.

Sometimes, particularly when Microsoft's windows.h is included, min/max are defined as macros, interfering with use of std::numeric_limits::min() and the like. To guard against this, the function name is wrapped in an extra set of parenthesis, which inhibits function-style macro expansion.

Two separate commits here: one for document.h and one for test code.

Sometimes, particularly when Microsoft's windows.h is included, min/max
are defined as macros, interfering with use of
std::numeric_limits::min() and the like.

To guard against this, the function name is wrapped in an extra set of
parenthesis, which inhibits function-style macro expansion.
@coveralls
Copy link

coveralls commented Sep 6, 2017

Coverage Status

Coverage remained the same at 99.918% when pulling e4c0ecf on chwarr:paren-minmax into 4bb4926 on miloyip:master.

@miloyip miloyip merged commit 5db5dd5 into Tencent:master Sep 6, 2017
@miloyip
Copy link
Collaborator

miloyip commented Sep 6, 2017

Thanks

@chwarr chwarr deleted the paren-minmax branch September 6, 2017 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants