dtoolbase: Avoid Windows's min/max macros

This commit is contained in:
Sam Edwards 2018-06-06 16:03:15 -06:00 committed by rdb
parent b7f8ddfe35
commit 4754ba524c
2 changed files with 6 additions and 5 deletions

View File

@ -60,6 +60,12 @@
#pragma warning (disable : 4577) #pragma warning (disable : 4577)
#endif /* WIN32_VC */ #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 #ifndef __has_builtin
#define __has_builtin(x) 0 #define __has_builtin(x) 0
#endif #endif
@ -198,10 +204,6 @@ typedef struct _object PyObject;
#include <limits.h> #include <limits.h>
#endif #endif
#ifdef PHAVE_MINMAX_H
#include <minmax.h>
#endif
#ifdef PHAVE_SYS_TIME_H #ifdef PHAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif #endif

View File

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