Bug 1475566 - Disable #pragma comments for MinGW Builds. r=glandium, a=lizzard
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.
--- 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
old mode 100644
new mode 100755
--- 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 "nsWindowsHelpers.h"
#include "workmonitor.h"
#include "serviceinstall.h"
#include "servicebase.h"
#include "registrycertificates.h"
#include "uachelper.h"
old mode 100644
new mode 100755
--- a/toolkit/xre/nsWindowsRestart.cpp
+++ b/toolkit/xre/nsWindowsRestart.cpp
@@ -12,17 +12,19 @@
#endif
#include "nsUTF8Utils.h"
#include <shellapi.h>
// Needed for CreateEnvironmentBlock
#include <userenv.h>
+#ifndef __MINGW32__
#pragma comment(lib, "userenv.lib")
+#endif
/**
* Get the length that the string will take and takes into account the
* additional length if the string needs to be quoted and if characters need to
* be escaped.
*/
static int ArgStrLen(const wchar_t *s)
{