From a771e362dfd61e67fddadbf36b5ef3f3115f8d81 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 19 Jul 2016 17:47:59 +0200 Subject: [PATCH] check for NOMINMAX issue on windows (fixes #291) --- include/pybind11/common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/pybind11/common.h b/include/pybind11/common.h index 1a734d4f..a278a9f0 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