Skip to content

Comments

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

Merged
Wumpf merged 1 commit intomainfrom
andreas/windows-fix-pinhole
Mar 8, 2024
Merged

Make pinhole.hpp robust against min/max preprocessor macros (typically from windows.h)#5432
Wumpf merged 1 commit intomainfrom
andreas/windows-fix-pinhole

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 sdk-cpp C/C++ API specific 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
Member

@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
Member

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
@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 include in changelog sdk-cpp C/C++ API specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pinhole.hpp compiler error with std::max

2 participants