chromiumembedded/cef

std::min expected an identifierC/C++(40)

Closed this issue · 4 comments

Describe the bug
A clear and concise description of what the bug is.

https://github.com/chromiumembedded/cef-project/blob/c3104bd6ab3fce9551edd4d74ed575605f37f4a0/examples/shared/resource_util.cc#L19

  const size_t pos = std::min(url.find('?'), url.find('#'));

To Reproduce

expected an identifierC/C++(40)
#define min(a,b) (((a) < (b)) ? (a) : (b))
Expands to:

(((url.find('?')) < (url.find('#'))) ? (url.find('?')) : (url.find('#')))

Describe the bug A clear and concise description of what the bug is.

https://github.com/chromiumembedded/cef-project/blob/c3104bd6ab3fce9551edd4d74ed575605f37f4a0/examples/shared/resource_util.cc#L19

  const size_t pos = std::min(url.find('?'), url.find('#'));

To Reproduce

expected an identifierC/C++(40)
#define min(a,b) (((a) < (b)) ? (a) : (b))
Expands to:

(((url.find('?')) < (url.find('#'))) ? (url.find('?')) : (url.find('#')))

Add "NOMINMAX" to PreprocessorDefinitions in your project setting , then your compile error will disappear.

9001

NOMINMAX is also already defined in the provided CMake Windows configuration.

Great