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 assumption that min/max macros will always be defined on a Microsoft compiler #72

Merged
merged 4 commits into from
Apr 24, 2018

Conversation

apmorton
Copy link
Contributor

min and max are not implicitly defined on MSVC, and the check performed in integral_limits.h can inadvertently define them in cases where they weren't already defined.

  • If Windows.h is never included, they will not be defined.
  • If NOMINMAX is defined before including Windows.h they will not be defined.

Using push_macro and pop_macro ensures they are restored to whatever state they were previously, while still allowing us to be sure they are undefined while evaluating integral_limits.h

@apmorton
Copy link
Contributor Author

apmorton commented Apr 22, 2018

I probably should have taken a closer look at the rest of the code base - it seems these are scattered all over the code base. I will update this PR to fix them all when I can. I have updated the PR to fix all the instances of this issue.

@jwellbelove jwellbelove changed the base branch from master to feature/min-max April 24, 2018 13:25
@jwellbelove jwellbelove merged commit dcd42ee into ETLCPP:feature/min-max Apr 24, 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.

2 participants