0

    if (timeoutMs >= std::numeric_limits<int>::max())
        intTimeoutMs = std::numeric_limits<int>::max();

In this code section, there is an override problem, I use define NOMINMAX, but it does not help to deal with it. I get the following error

error: C2062: type 'unknown-type' unexpected

I used the compilers for MVSC2017, 2019. I used define NO_MIN_MAX and NOMINMAX.

Also took the code in additional brackets

if (timeoutMs >= (std::numeric_limits<int>::max()))
        intTimeoutMs = (std::numeric_limits<int>::max());
CyberMavka
  • 11
  • 3
  • Did you have the `#define NOMINMAX` **before** your `#include `? It has to be so placed. – Adrian Mole Jan 23 '23 at 11:29
  • @AdrianMole In the header I'm working with, windows.h is not included, it's somewhere in the project. The project is not mine, I'm just trying to build it, but there are some problems with it – CyberMavka Jan 23 '23 at 11:43

2 Answers2

0

As usual, when I wrote a question, I found the answer. We can radically disable these macros, but we need to remember that we need to be sure that we will not need them

#undef min #undef max

Or use the code from chromium Source

CyberMavka
  • 11
  • 3
0

If a macro name is followed by (, it is interpreted as a function-like macro. You can stop a function-like macro from expanding by enclosing the macro name in parentheses: (max)().

zdf
  • 4,382
  • 3
  • 18
  • 29