-
Notifications
You must be signed in to change notification settings - Fork 164
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
Use of min and max in Gil conflicts with Win32-API on Windows/MSVC #744
Comments
Thanks @ckormanyos for reporting this. |
We use (min)() etc. in Math and Multiprecision. When I just started boosting, I learned or thought I learned from @jzmaddock that this parenthesis-based workaround is the Boost way. |
I’ll just PR the trivial changes tonight and you can decide at your convenience if it’s a go or no-go. |
I'm used to this trick as well.
Thank you. I'm sure nobody will object it and your PR will be merged. Especially, that we had accepted similar fixes e.g. #328 BTW, AFAICT, we mix both workarounds, the |
Actual behavior
I was recently using Boost.Gil with traditional Win32-API programming on MSVC (in Windows) and discovered a few conflicts with
windows.h
. Unfortunatelywindows.h
definesmin()
andmax()
macros that conflict with the standard C++ ones.Defining
NOMINMAX
(or un-definingBOOST_USE_WINDOWS_H)
above inclusion of Windows-headers in client code works around this.I could PR the fix with trivial changes on 9 lines. Should I do this PR?
Or would you just prefer to leave it, sort of forcing clients to definine
NOMINMAX
?Expected behavior
It might be preferable, however, to not require defining
NOMINMAX
.C++ Minimal Working Example
I found 9 instances in total, one example is here.
Instead of:
use
Environment
MSVC 141, 142, 143 solely in combination with Boost.Gil headers and the inclusion of
<windows.h>
.The text was updated successfully, but these errors were encountered: