Browse Source

dtoolbase: Avoid Windows's min/max macros

Sam Edwards 7 years ago
parent
commit
4754ba524c
2 changed files with 6 additions and 5 deletions
  1. 6 4
      dtool/src/dtoolbase/dtoolbase.h
  2. 0 1
      makepanda/makepanda.py

+ 6 - 4
dtool/src/dtoolbase/dtoolbase.h

@@ -60,6 +60,12 @@
 #pragma warning (disable : 4577)
 #endif  /* WIN32_VC */
 
+/* Windows likes to define min() and max() macros, which will conflict with
+   std::min() and std::max() respectively, unless we do this: */
+#ifdef WIN32
+#define NOMINMAX
+#endif
+
 #ifndef __has_builtin
 #define __has_builtin(x) 0
 #endif
@@ -198,10 +204,6 @@ typedef struct _object PyObject;
 #include <limits.h>
 #endif
 
-#ifdef PHAVE_MINMAX_H
-#include <minmax.h>
-#endif
-
 #ifdef PHAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif

+ 0 - 1
makepanda/makepanda.py

@@ -2310,7 +2310,6 @@ DTOOL_CONFIG=[
     ("PHAVE_SYS_MALLOC_H",             'UNDEF',                  'UNDEF'),
     ("PHAVE_ALLOCA_H",                 'UNDEF',                  '1'),
     ("PHAVE_LOCALE_H",                 'UNDEF',                  '1'),
-    ("PHAVE_MINMAX_H",                 '1',                      'UNDEF'),
     ("PHAVE_SSTREAM",                  '1',                      '1'),
     ("PHAVE_NEW",                      '1',                      '1'),
     ("PHAVE_SYS_TYPES_H",              '1',                      '1'),