diff --git a/Plugin/CutPlane.cpp b/Plugin/CutPlane.cpp
index ad68c3bbfc909f48fb60f1ac52b979d57830b90a..ca0878fb72ceeb75f5312a35c3d7f96f81aa03f8 100644
--- a/Plugin/CutPlane.cpp
+++ b/Plugin/CutPlane.cpp
@@ -12,6 +12,11 @@
 #include "Draw.h"
 #endif
 
+#if defined(WIN32)
+#undef min
+#undef max
+#endif
+
 extern Context_T CTX;
 
 int GMSH_CutPlanePlugin::iview = 0;
diff --git a/Plugin/Probe.cpp b/Plugin/Probe.cpp
index 51e69d30c0bbad4fc8351910c939c0c96c310128..0ccafc82a32ff4101f96364c4603a493aa0acc23 100644
--- a/Plugin/Probe.cpp
+++ b/Plugin/Probe.cpp
@@ -14,6 +14,11 @@
 #include "Draw.h"
 #endif
 
+#if defined(WIN32)
+#undef min
+#undef max
+#endif
+
 extern Context_T CTX;
 
 int GMSH_ProbePlugin::iview = 0;