diff --git a/include/pybind11/common.h b/include/pybind11/common.h index 1a734d4f9..a278a9f0e 100644 --- a/include/pybind11/common.h +++ b/include/pybind11/common.h @@ -49,7 +49,11 @@ #include #include -#ifdef isalnum +#if defined(_WIN32) && (defined(min) || defined(max)) +# error Macro clash with min and max -- define NOMINMAX when compiling your program on Windows +#endif + +#if defined(isalnum) # undef isalnum # undef isalpha # undef islower