Closed Kethers closed 11 months ago
Thank you for the contribution!
Windows does define min/max macros which are typically incompatible with the C++ standard library as it includes a number of functions with those names. :(
Usually, in my experience, most modern applications that include windows header with #define NOMINMAX
before including it.
But here, it seems that the fix is easy enough. I'll see if I can reproduce your issue locally to validate the fix as well.
I was able to reproduce locally. I'll add a check to make sure that this issue is checked by CI to avoid it coming back in the future. Thanks!
@all-contributors add @Kethers as code
@nfrechette
I've put up a pull request to add @Kethers! :tada:
fix: usage of std::numeric_limits::max() in memory_utils.h conflicted with minwindef.h under some circumstances
Hi, I use rtm in my personal project. Somehow I include the "minwindef.h" file (actually I don't know where it's included, maybe it's included by some third-party library I am using) and when I build project on Windows, an error happen:
Line 208:
return uint64_t(input) <= uint64_t((std::numeric_limits<DstType>::max());
I jump to source code of max and it turns out to be in minwindef.h:With google it's easy to find out solution: https://stackoverflow.com/questions/1394132/macro-and-member-function-conflict.
It's a tricky and potential build error only happens in specific situation. I try to fix it in this PR, and maybe there's a better way?