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 reader.h #1302

Merged
merged 1 commit into from
Sep 10, 2018

Conversation

chwarr
Copy link
Contributor

@chwarr chwarr commented Jun 27, 2018

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.

This is a similar commit to 6e38649, but fixes uses of
std::numeric_limits added after that commit, like those introduced in
2ea4343.

@chwarr
Copy link
Contributor Author

chwarr commented Jun 27, 2018

See also related issue for a proposal I have to prevent these from cropping up in the future.

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.

This is a similar commit to 6e38649, but fixes uses of
std::numeric_limits added after that commit, like those introduced in
2ea4343.
@chwarr
Copy link
Contributor Author

chwarr commented Jul 10, 2018

Looks like the previous build failure may have been transient. I've rebased this atop 129d19b and pushed again. This will make the merge easier and trigger a new CI build.

@coveralls
Copy link

coveralls commented Jul 10, 2018

Coverage Status

Coverage remained the same at 99.924% when pulling 960b9cf on chwarr:min-max-guard into 129d19b on Tencent:master.

@miloyip miloyip merged commit 08b1a8a into Tencent:master Sep 10, 2018
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.

3 participants