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

Make pinhole.hpp robust against min/max preprocessor macros (typically from windows.h) #5432

Merged
merged 1 commit into from Mar 8, 2024

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Mar 8, 2024

What

And add a test to ensure we don't run into this again!

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!

…dows.h)

And add a test to ensure we don't run into this again!
@Wumpf Wumpf added 🪳 bug Something isn't working 🌊 C++ API C or C++ logging API include in changelog labels Mar 8, 2024
@Wumpf Wumpf changed the title Make pinhole.hpp robust against min/max preprocessor macros (from windows.h) Make pinhole.hpp robust against min/max preprocessor macros (typically from windows.h) Mar 8, 2024
Copy link
Contributor

@abey79 abey79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I hate this :)

//
// This test checks that rerun.h is robust against this issue by explicitly setting `min`/`max` macros and including rerun.hpp.
#define min(a, b) (this does not compile)
#define max(a, b) (this does not compile)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@Wumpf Wumpf merged commit 5cd2b6a into main Mar 8, 2024
40 checks passed
@Wumpf Wumpf deleted the andreas/windows-fix-pinhole branch March 8, 2024 11:15
@emilk emilk changed the title Make pinhole.hpp robust against min/max preprocessor macros (typically from windows.h) Make pinhole.hpp robust against min/max preprocessor macros (typically from windows.h) Apr 5, 2024
@emilk emilk changed the title Make pinhole.hpp robust against min/max preprocessor macros (typically from windows.h) Make pinhole.hpp robust against min/max preprocessor macros (typically from windows.h) Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working 🌊 C++ API C or C++ logging API include in changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pinhole.hpp compiler error with std::max
2 participants