Bug 830801 - Part 3. Remove NOMINMAX define from cpp source. r=mshal
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Mon, 03 Aug 2015 10:07:20 +0900
changeset 287463 40fb01ba8c9287c5fb982a8cbffdad6862c296fc
parent 287462 0450e3e2125e841a1f9fd05572792840e912d184
child 287464 838a7d98c1d41c2bf67497d0a80cca98a6001899
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs830801
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 830801 - Part 3. Remove NOMINMAX define from cpp source. r=mshal
config/gcc-stl-wrapper.template.h
config/msvc-stl-wrapper.template.h
embedding/components/printingui/win/nsPrintDialogUtil.cpp
memory/replace/logalloc/replay/Replay.cpp
toolkit/crashreporter/client/crashreporter_win.cpp
--- a/config/gcc-stl-wrapper.template.h
+++ b/config/gcc-stl-wrapper.template.h
@@ -12,21 +12,16 @@
 // compiling ObjC.
 #if defined(__EXCEPTIONS) && __EXCEPTIONS && !(__OBJC__ && __GNUC__ && XP_IOS)
 #  error "STL code can only be used with -fno-exceptions"
 #endif
 
 // Silence "warning: #include_next is a GCC extension"
 #pragma GCC system_header
 
-#ifdef _WIN32
-// Suppress windef.h min and max macros - they make std::min/max not compile.
-#define NOMINMAX 1
-#endif
-
 // mozalloc.h wants <new>; break the cycle by always explicitly
 // including <new> here.  NB: this is a tad sneaky.  Sez the gcc docs:
 //
 //    `#include_next' does not distinguish between <file> and "file"
 //    inclusion, nor does it check that the file you specify has the
 //    same name as the current file. It simply looks for the file
 //    named, starting with the directory in the search path after the
 //    one where the current file was found.
--- a/config/msvc-stl-wrapper.template.h
+++ b/config/msvc-stl-wrapper.template.h
@@ -7,19 +7,16 @@
 
 #ifndef mozilla_${HEADER}_h
 #define mozilla_${HEADER}_h
 
 #if _HAS_EXCEPTIONS
 #  error "STL code can only be used with -fno-exceptions"
 #endif
 
-// Suppress windef.h min and max macros - they make std::min/max not compile.
-#define NOMINMAX 1
-
 // Code built with !_HAS_EXCEPTIONS calls std::_Throw(), but the win2k
 // CRT doesn't export std::_Throw().  So we define it.
 #ifndef mozilla_Throw_h
 #  include "mozilla/throw_msvc.h"
 #endif
 
 // Code might include <new> before other wrapped headers, but <new>
 // includes <exception> and so we want to wrap it.  But mozalloc.h
--- a/embedding/components/printingui/win/nsPrintDialogUtil.cpp
+++ b/embedding/components/printingui/win/nsPrintDialogUtil.cpp
@@ -15,18 +15,16 @@ To Build This:
 
 WIN_LIBS=                                       \
         winspool.lib                           \
         comctl32.lib                           \
         comdlg32.lib
 
 ---------------------------------------------------------------------- */
 
-#define NOMINMAX 1
-
 #include "plstr.h"
 #include <windows.h>
 #include <tchar.h>
 
 #include <unknwn.h>
 #include <commdlg.h>
 
 #include "nsIWebBrowserPrint.h"
--- a/memory/replace/logalloc/replay/Replay.cpp
+++ b/memory/replace/logalloc/replay/Replay.cpp
@@ -3,19 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #define MOZ_MEMORY_IMPL
 #include "mozmemory_wrap.h"
 
 #ifdef _WIN32
-/* windef.h, which windows.h includes, #defines min and max, which
- * breaks std::min. Defining NOMINMAX prevents those #defines. */
-#define NOMINMAX
 #include <windows.h>
 #include <io.h>
 typedef int ssize_t;
 #else
 #include <sys/mman.h>
 #include <unistd.h>
 #endif
 #include <algorithm>
--- a/toolkit/crashreporter/client/crashreporter_win.cpp
+++ b/toolkit/crashreporter/client/crashreporter_win.cpp
@@ -2,18 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifdef WIN32_LEAN_AND_MEAN
 #undef WIN32_LEAN_AND_MEAN
 #endif
 
-#define NOMINMAX
-
 #include "crashreporter.h"
 
 #include <windows.h>
 #include <versionhelpers.h>
 #include <commctrl.h>
 #include <richedit.h>
 #include <shellapi.h>
 #include <shlobj.h>