From 4bfa7c0dd0c8773576b100ca892b4782465d5f96 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Fri, 26 Jun 2009 11:08:20 +0000
Subject: [PATCH] fix msvc compile

---
 Common/CreateFile.cpp  | 5 -----
 Common/Options.cpp     | 5 -----
 Graphics/PixelBuffer.h | 6 ++++++
 Graphics/drawContext.h | 6 ++++++
 Plugin/CutPlane.cpp    | 5 -----
 Plugin/Probe.cpp       | 5 -----
 6 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/Common/CreateFile.cpp b/Common/CreateFile.cpp
index 5731e1490e..55bca74e02 100644
--- a/Common/CreateFile.cpp
+++ b/Common/CreateFile.cpp
@@ -23,11 +23,6 @@
 #include "gl2yuv.h"
 #endif
 
-#if defined(WIN32)
-#undef min
-#undef max
-#endif
-
 int GuessFileFormatFromFileName(std::string fileName)
 {
   std::string ext = SplitFileName(fileName)[2];
diff --git a/Common/Options.cpp b/Common/Options.cpp
index 893e5902f8..d4d17aec8e 100644
--- a/Common/Options.cpp
+++ b/Common/Options.cpp
@@ -40,11 +40,6 @@
 #include "clippingWindow.h"
 #endif
 
-#if defined(WIN32)
-#undef min
-#undef max
-#endif
-
 // General routines for string options
 
 bool StringOption(int action, const char *category, int num, 
diff --git a/Graphics/PixelBuffer.h b/Graphics/PixelBuffer.h
index 4669b11afe..2c3216da74 100644
--- a/Graphics/PixelBuffer.h
+++ b/Graphics/PixelBuffer.h
@@ -11,6 +11,12 @@
 #include "GmshMessage.h"
 #include "Draw.h"
 
+#if defined(WIN32)
+#include <windows.h>
+#undef min
+#undef max
+#endif
+
 #if defined(__APPLE__)
 #include <OpenGL/gl.h>
 #include <OpenGL/glu.h>
diff --git a/Graphics/drawContext.h b/Graphics/drawContext.h
index 42da54c3a6..50a7d6a1d1 100644
--- a/Graphics/drawContext.h
+++ b/Graphics/drawContext.h
@@ -11,6 +11,12 @@
 #include <set>
 #include "SBoundingBox3d.h"
 
+#if defined(WIN32)
+#include <windows.h>
+#undef min
+#undef max
+#endif
+
 #if defined(__APPLE__)
 #include <OpenGL/gl.h>
 #include <OpenGL/glu.h>
diff --git a/Plugin/CutPlane.cpp b/Plugin/CutPlane.cpp
index b1cca992e1..4fb9bfe9e9 100644
--- a/Plugin/CutPlane.cpp
+++ b/Plugin/CutPlane.cpp
@@ -12,11 +12,6 @@
 #include "Draw.h"
 #endif
 
-#if defined(WIN32)
-#undef min
-#undef max
-#endif
-
 int GMSH_CutPlanePlugin::iview = 0;
 
 StringXNumber CutPlaneOptions_Number[] = {
diff --git a/Plugin/Probe.cpp b/Plugin/Probe.cpp
index a6d617f5d8..3f821e686a 100644
--- a/Plugin/Probe.cpp
+++ b/Plugin/Probe.cpp
@@ -14,11 +14,6 @@
 #include "Draw.h"
 #endif
 
-#if defined(WIN32)
-#undef min
-#undef max
-#endif
-
 int GMSH_ProbePlugin::iview = 0;
 
 StringXNumber ProbeOptions_Number[] = {
-- 
GitLab