Skip to content
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

Failed to build with <Windows.h> #1531

Closed
ilgiz-badamshin opened this issue Mar 20, 2019 · 4 comments
Closed

Failed to build with <Windows.h> #1531

ilgiz-badamshin opened this issue Mar 20, 2019 · 4 comments
Assignees
Labels
kind: bug platform: visual studio related to MSVC solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Milestone

Comments

@ilgiz-badamshin
Copy link

Related to #1514

  • What is the issue you have?
    Failed to build if <Windows.h> is included:

C4003: not enough arguments for function-like macro invocation 'max'

Code:
assert(p2 <= std::numeric_limits<std::uint64_t>::max() / 10);
should be:
assert(p2 <= (std::numeric_limits<std::uint64_t>::max)() / 10);

@nlohmann
Copy link
Owner

Thanks for reporting! Could you please check if 9d6ab90 fixes the issue?

@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Mar 20, 2019
@ilgiz-badamshin
Copy link
Author

Build succeeded.

Thanks.

@nlohmann nlohmann self-assigned this Mar 20, 2019
@nlohmann nlohmann added this to the Release 3.6.1 milestone Mar 20, 2019
@nlohmann
Copy link
Owner


🔖 Release item

This issue/PR will be part of the next release of the library. This template helps preparing the release notes.

Type

  • ✨ New Feature
  • 🐛 Bug Fix
  • ⚡️ Improvement
  • 🔨 Further Change
  • 🔥 Deprecated function

Description


@dvj
Copy link

dvj commented Mar 20, 2019

If you want to try to avoid this type of regression in the future, a test that includes windows.h (a la https://github.com/CLIUtils/CLI11/pull/145/files#diff-da661fc0dc16940197d2112712cbf2bb) could be added as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug platform: visual studio related to MSVC solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

3 participants