Bug 1475566 Disable #pragma comments for MinGW Builds r=glandium
authorTom Ritter <tom@mozilla.com>
Wed, 29 Aug 2018 03:50:39 +0000
changeset 488802 14f703675b64439b423164643ce22f93984ea949
parent 488801 b4115d7d4f642978f0301479f0af455d2e1c989c
child 488872 56cfcee29fbc4f0816c5d5dedbaf0136b5e84773
child 488879 d214235eef08c5918ef02e07db21de9763e5ba31
push id9734
push usershindli@mozilla.com
push dateThu, 30 Aug 2018 12:18:07 +0000
treeherdermozilla-beta@71c71ab3afae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1475566
milestone63.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 1475566 Disable #pragma comments for MinGW Builds r=glandium In the MinGW browser build job, we're going to use -fms-extensions, which will tell clang to start processing these comments. Clang cannot process them correctly (it's an upstream bug) but it doesn't need to, because we include the libs we need in moz.build files. So we exclude them for MinGW builds. mingw-clang gets them wrong and mingw-gcc (which doesn't even work anymore on -central) ignored them. In the future, with a llvm fix, we could clean up the moz.build files and re-enable these comments. Differential Revision: https://phabricator.services.mozilla.com/D3527
ipc/chromium/src/base/time_win.cc
media/gmp-clearkey/0.1/WMFUtils.cpp
testing/tools/screenshot/win32-screenshot.cpp
toolkit/components/maintenanceservice/workmonitor.cpp
toolkit/system/windowsDHCPClient/WindowsNetworkFunctionsWrapper.cpp
toolkit/xre/nsWindowsRestart.cpp
--- a/ipc/chromium/src/base/time_win.cc
+++ b/ipc/chromium/src/base/time_win.cc
@@ -33,17 +33,19 @@
 // will only increase the system-wide timer if we're not running on battery
 // power.  Using timeBeginPeriod(1) is a requirement in order to make our
 // message loop waits have the same resolution that our time measurements
 // do.  Otherwise, WaitForSingleObject(..., 1) will no less than 15ms when
 // there is nothing else to waken the Wait.
 
 #include "base/time.h"
 
+#ifndef __MINGW32__
 #pragma comment(lib, "winmm.lib")
+#endif
 #include <windows.h>
 #include <mmsystem.h>
 
 #include "base/basictypes.h"
 #include "base/lock.h"
 #include "base/logging.h"
 #include "base/singleton.h"
 #include "mozilla/Casting.h"
--- a/media/gmp-clearkey/0.1/WMFUtils.cpp
+++ b/media/gmp-clearkey/0.1/WMFUtils.cpp
@@ -19,18 +19,20 @@
 #include <versionhelpers.h>
 
 #include <algorithm>
 #include <stdio.h>
 
 #define INITGUID
 #include <guiddef.h>
 
+#ifndef __MINGW32__
 #pragma comment(lib, "mfuuid.lib")
 #pragma comment(lib, "wmcodecdspuuid")
+#endif
 
 void LOG(const char* format, ...)
 {
 #ifdef WMF_DECODER_LOG
   va_list args;
   va_start(args, format);
   vprintf(format, args);
 #endif
--- a/testing/tools/screenshot/win32-screenshot.cpp
+++ b/testing/tools/screenshot/win32-screenshot.cpp
@@ -37,17 +37,19 @@
  // VS2015: Platform SDK 8.1's GdiplusTypes.h uses the min macro
 #undef NOMINMAX
 #undef WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <gdiplus.h>
 
 // Link w/ subsystem windows so we don't get a console when executing
 // this binary.
+#ifndef __MINGW32__
 #pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:wmainCRTStartup")
+#endif
 
 using namespace Gdiplus;
 
 // From http://msdn.microsoft.com/en-us/library/ms533843%28VS.85%29.aspx
 static int GetEncoderClsid(const WCHAR* format, CLSID* pClsid)
 {
   UINT  num = 0;          // number of image encoders
   UINT  size = 0;         // size of the image encoder array in bytes
--- a/toolkit/components/maintenanceservice/workmonitor.cpp
+++ b/toolkit/components/maintenanceservice/workmonitor.cpp
@@ -3,21 +3,23 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <shlobj.h>
 #include <shlwapi.h>
 #include <wtsapi32.h>
 #include <userenv.h>
 #include <shellapi.h>
 
+#ifndef __MINGW32__
 #pragma comment(lib, "wtsapi32.lib")
 #pragma comment(lib, "userenv.lib")
 #pragma comment(lib, "shlwapi.lib")
 #pragma comment(lib, "ole32.lib")
 #pragma comment(lib, "rpcrt4.lib")
+#endif
 
 #include "mozilla/CmdLineAndEnvUtils.h"
 #include "nsWindowsHelpers.h"
 
 #include "workmonitor.h"
 #include "serviceinstall.h"
 #include "servicebase.h"
 #include "registrycertificates.h"
--- a/toolkit/system/windowsDHCPClient/WindowsNetworkFunctionsWrapper.cpp
+++ b/toolkit/system/windowsDHCPClient/WindowsNetworkFunctionsWrapper.cpp
@@ -1,19 +1,20 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 "WindowsNetworkFunctionsWrapper.h"
 
-
+#ifndef __MINGW32__
 #pragma comment(lib, "IPHLPAPI.lib")
 #pragma comment(lib, "dhcpcsvc.lib" )
+#endif
 
 namespace mozilla {
 namespace toolkit {
 namespace system {
 namespace windowsDHCPClient {
 
 NS_IMPL_ISUPPORTS(WindowsNetworkFunctionsWrapper, nsISupports)
 
@@ -38,9 +39,9 @@ DWORD WindowsNetworkFunctionsWrapper::Dh
     _Inout_ LPDWORD               apSize,
     _In_    LPWSTR                aRequestIdStr)
 {
   return DhcpRequestParams(aFlags, aReserved, aAdapterName, aClassId, aSendParams, aRecdParams, aBuffer, apSize, aRequestIdStr);
 }
 } // namespace windowsDHCPClient
 } // namespace system
 } // namespace toolkit
-} // namespace mozilla
\ No newline at end of file
+} // namespace mozilla
--- a/toolkit/xre/nsWindowsRestart.cpp
+++ b/toolkit/xre/nsWindowsRestart.cpp
@@ -13,17 +13,19 @@
 
 #include "mozilla/CmdLineAndEnvUtils.h"
 #include "nsUTF8Utils.h"
 
 #include <shellapi.h>
 
 // Needed for CreateEnvironmentBlock
 #include <userenv.h>
+#ifndef __MINGW32__
 #pragma comment(lib, "userenv.lib")
+#endif
 
 /**
  * Convert UTF8 to UTF16 without using the normal XPCOM goop, which we
  * can't link to updater.exe.
  */
 static char16_t*
 AllocConvertUTF8toUTF16(const char *arg)
 {