Bug 1365788 - Always define NOMINMAX in spidermonkey. r?sfink
--- a/js/src/jswin.h
+++ b/js/src/jswin.h
@@ -10,18 +10,16 @@
/*
* This file is a wrapper around <windows.h> to prevent the mangling of
* various function names throughout the codebase.
*/
#ifdef XP_WIN
# include <windows.h>
# undef assert
-# undef min
-# undef max
# undef GetProp
# undef MemoryBarrier
# undef SetProp
# undef CONST
# undef STRICT
# undef LEGACY
# undef THIS
# undef PASSTHROUGH
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -732,18 +732,15 @@ if CONFIG['JS_HAS_CTYPES']:
if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wno-shadow', '-Werror=format']
# Suppress warnings in third-party code.
if CONFIG['CLANG_CXX']:
SOURCES['jsdtoa.cpp'].flags += ['-Wno-implicit-fallthrough']
-if CONFIG['OS_ARCH'] == 'WINNT':
- DEFINES['NOMINMAX'] = True
-
# Generate GC statistics phase data.
GENERATED_FILES += ['gc/StatsPhasesGenerated.h']
StatsPhasesGeneratedHeader = GENERATED_FILES['gc/StatsPhasesGenerated.h']
StatsPhasesGeneratedHeader.script = 'gc/GenerateStatsPhases.py:generateHeader'
GENERATED_FILES += ['gc/StatsPhasesGenerated.cpp']
StatsPhasesGeneratedCpp = GENERATED_FILES['gc/StatsPhasesGenerated.cpp']
StatsPhasesGeneratedCpp.script = 'gc/GenerateStatsPhases.py:generateCpp'
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -806,16 +806,18 @@ case "$target" in
dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
dnl Probably also a compiler bug, but what can you do?
PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
LDFLAGS="$LDFLAGS -DYNAMICBASE"
RCFLAGS="-nologo"
fi
AC_DEFINE(HAVE__MSIZE)
AC_DEFINE(WIN32_LEAN_AND_MEAN)
+ dnl See http://support.microsoft.com/kb/143208 to use STL
+ AC_DEFINE(NOMINMAX)
BIN_SUFFIX='.exe'
MOZ_USER_DIR="Mozilla"
case "$host_os" in
cygwin*|msvc*|mks*)
AC_MSG_ERROR([Using a Cygwin build environment is unsupported. Configure cannot check for presence of necessary headers. Please upgrade to MozillaBuild; see https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
;;
esac