-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Replace limit macros with std::numeric_limits #3723
Replace limit macros with std::numeric_limits #3723
Conversation
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. |
7c7bf27
to
0adf6cd
Compare
Not sure why this worked previously. Maybe |
There is a problem if you do in this way. In a Windows platform if you just #define max(a,b) (((a) > (b)) ? (a) : (b)) and this piece of code will expand into std::numeric_limits<std::int32_t>::(((a) > (b)) ? (a) : (b)) Which is an error. (std::numeric_limits<std::int32_t>::max)() |
Thanks. I was already aware of this. There's no point in fixing this now. This PR needs to be completely redone due to hundreds of merge conflicts after #3724 has been merged.
This is already done in other places for this exact reason. The only surprising thing is that our unit test didn't catch this. Edit: Not that surprising after all. |
Windows builds are expected to fail now. |
🤦♂️ |
50e937e
to
53139fd
Compare
53139fd
to
104ed7d
Compare
104ed7d
to
de9d0f8
Compare
Thanks! |
Replace uses of
INT_MIN
/INT_MAX
, etc. withstd::numeric_limits
and consistently usestd
namespaced integer types.Fixes #3722.