-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
warnings in msvc about mix/max macro while windows.h is used in the project #762
Labels
platform: visual studio
related to MSVC
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
Milestone
Comments
Does this also occur in the |
just tested dev branch - yes, even the errors appeared:
changing line 3583 from: |
Thanks! I'll have a look. |
nlohmann
added a commit
that referenced
this issue
Oct 2, 2017
nlohmann
added
the
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
label
Oct 2, 2017
@crea7or Can you please check if this works now? |
Thanks for checking! |
nlohmann
pushed a commit
that referenced
this issue
Jul 30, 2022
* Fixed latest build error in msvc platform warnings in msvc about mix/max macro while windows.h is used in the project #762 * Update for CI None * Update single_include/nlohmann/json.hpp Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com> Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
platform: visual studio
related to MSVC
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
In the version 2.1.1, msvc generates a few warnings about std::numeric_limits<>::max() (and min) usage. This is because windows.h have their own min/max macros definitions in the global namespace (here is microsoft kb article about it..
warning exact text: warning C4003: not enough actual parameters for macro 'max'
possible fixes:
1)
#define NOMINMAX
std::numeric_limits<uint8_t>::max() => (std::numeric_limits<uint8_t>::max)()
First two methods can produce problems, due to use original windows min/max in the gdi and more.
the third method should be tested on the other compilers.
Source to reproduce the problem:
The text was updated successfully, but these errors were encountered: