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 158611 3930e0fc40aca2ec07979db52f5c8a57edf244b4
parent 158575 8a7ed8362caa0c86108c442f303f1e6762b58a9c
child 158612 a6e99acbb26f6a15c920ee380d6421eddcdf711d
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbsmedberg
bugs945148
milestone28.0a1
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__)