Bug 945148: Prevent FACILITY_VISUALCPP redefinition in nsDllMain.cpp, with pre-2012 MSVC with Windows 8 SDK. r=bsmedberg
authorDaniel Holbert <dholbert@cs.stanford.edu>
Tue, 03 Dec 2013 09:33:57 -0800
changeset 158541 3930e0fc40aca2ec07979db52f5c8a57edf244b4
parent 158540 8a7ed8362caa0c86108c442f303f1e6762b58a9c
child 158542 a6e99acbb26f6a15c920ee380d6421eddcdf711d
push id37023
push userdholbert@mozilla.com
push dateTue, 03 Dec 2013 17:34:22 +0000
treeherdermozilla-inbound@a6e99acbb26f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs945148
milestone28.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 945148: Prevent FACILITY_VISUALCPP redefinition in nsDllMain.cpp, with pre-2012 MSVC with Windows 8 SDK. r=bsmedberg
toolkit/library/nsDllMain.cpp
--- a/toolkit/library/nsDllMain.cpp
+++ b/toolkit/library/nsDllMain.cpp
@@ -1,14 +1,19 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
  
 #include <windows.h>
+#if defined(_WIN32_WINNT_WIN8) && defined(_MSC_VER) && _MSC_VER < 1700
+// The Windows 8 SDK defines FACILITY_VISUALCPP in winerror.h, and MSVC
+// defines it in delayimp.h previous to VS2012.
+#undef FACILITY_VISUALCPP
+#endif
 #include <delayimp.h>
 #include "nsToolkit.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/WindowsVersion.h"
 
 using mozilla::IsWin8OrLater;
 
 #if defined(__GNUC__)