diff --git a/accessible/ipc/win/moz.build b/accessible/ipc/win/moz.build index e6478444ca..c8b5253589 100644 --- a/accessible/ipc/win/moz.build +++ b/accessible/ipc/win/moz.build @@ -4,7 +4,8 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. if CONFIG['COMPILE_ENVIRONMENT']: - DIRS += ['typelib'] + if CONFIG['CC_TYPE'] == 'msvc': + DIRS += ['typelib'] # With --disable-accessibility, we need to compile PDocAccessible.ipdl (which # also depends on COMPtrTypes.h), but not the C++. diff --git a/accessible/ipc/win/typelib/moz.build b/accessible/ipc/win/typelib/moz.build index 1246e80e19..e580370fd2 100644 --- a/accessible/ipc/win/typelib/moz.build +++ b/accessible/ipc/win/typelib/moz.build @@ -3,10 +3,11 @@ # 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/. -FINAL_TARGET_FILES += [ - '!Accessible.tlb', -] +if CONFIG['CC_TYPE'] == 'msvc': + FINAL_TARGET_FILES += [ + '!Accessible.tlb', + ] -GENERATED_FILES += [ - 'Accessible.tlb', -] + GENERATED_FILES += [ + 'Accessible.tlb', + ] diff --git a/application/basilisk/app/nsBrowserApp.cpp b/application/basilisk/app/nsBrowserApp.cpp index c8b6293dbb..d79c302769 100644 --- a/application/basilisk/app/nsBrowserApp.cpp +++ b/application/basilisk/app/nsBrowserApp.cpp @@ -7,9 +7,9 @@ #include "mozilla/AppData.h" #include "application.ini.h" #include "nsXPCOMGlue.h" +#include #if defined(XP_WIN) #include -#include #elif defined(XP_UNIX) #include #include diff --git a/application/basilisk/components/shell/nsWindowsShellService.cpp b/application/basilisk/components/shell/nsWindowsShellService.cpp index a45f539321..413d8bada2 100644 --- a/application/basilisk/components/shell/nsWindowsShellService.cpp +++ b/application/basilisk/components/shell/nsWindowsShellService.cpp @@ -5,6 +5,8 @@ #include "nsWindowsShellService.h" +#include + #include "imgIContainer.h" #include "imgIRequest.h" #include "mozilla/gfx/2D.h" diff --git a/build/win32/moz.build b/build/win32/moz.build index 8b0f8195e5..6ca07c1baa 100644 --- a/build/win32/moz.build +++ b/build/win32/moz.build @@ -14,14 +14,15 @@ if CONFIG['ENABLE_TESTS']: NO_PGO = True -if CONFIG['WIN32_REDIST_DIR'] and CONFIG['COMPILE_ENVIRONMENT']: - for f in ['MSVC_C_RUNTIME_DLL', 'MSVC_CMP_RUNTIME_DLL', 'MSVC_CXX_RUNTIME_DLL']: - FINAL_TARGET_FILES += [ - '%%%s/%s' % (CONFIG['WIN32_REDIST_DIR'], CONFIG[f]) - ] +if CONFIG['CC_TYPE'] == 'msvc': + if CONFIG['WIN32_REDIST_DIR'] and CONFIG['COMPILE_ENVIRONMENT']: + for f in ['MSVC_C_RUNTIME_DLL', 'MSVC_CMP_RUNTIME_DLL', 'MSVC_CXX_RUNTIME_DLL']: + FINAL_TARGET_FILES += [ + '%%%s/%s' % (CONFIG['WIN32_REDIST_DIR'], CONFIG[f]) + ] -if CONFIG['WIN_UCRT_REDIST_DIR'] and CONFIG['COMPILE_ENVIRONMENT']: - for f in ['api-ms-win-*.dll', 'ucrtbase.dll']: - FINAL_TARGET_FILES += [ - '%%%s/%s' % (CONFIG['WIN_UCRT_REDIST_DIR'], f) - ] + if CONFIG['WIN_UCRT_REDIST_DIR'] and CONFIG['COMPILE_ENVIRONMENT']: + for f in ['api-ms-win-*.dll', 'ucrtbase.dll']: + FINAL_TARGET_FILES += [ + '%%%s/%s' % (CONFIG['WIN_UCRT_REDIST_DIR'], f) + ] diff --git a/dom/media/platforms/wmf/DXVA2Manager.cpp b/dom/media/platforms/wmf/DXVA2Manager.cpp index fbb659fac7..304b91ed36 100644 --- a/dom/media/platforms/wmf/DXVA2Manager.cpp +++ b/dom/media/platforms/wmf/DXVA2Manager.cpp @@ -20,7 +20,7 @@ #include "nsPrintfCString.h" #include "VideoUtils.h" -const CLSID CLSID_VideoProcessorMFT = +const CLSID sCLSID_VideoProcessorMFT = { 0x88753b26, 0x5b24, @@ -666,7 +666,7 @@ D3D11DXVA2Manager::Init(layers::KnowsCompositor* aKnowsCompositor, } mTransform = new MFTDecoder(); - hr = mTransform->Create(CLSID_VideoProcessorMFT); + hr = mTransform->Create(sCLSID_VideoProcessorMFT); if (!SUCCEEDED(hr)) { aFailureReason = nsPrintfCString("MFTDecoder::Create(CLSID_VideoProcessorMFT) failed with code %X", hr); return hr; diff --git a/dom/media/platforms/wmf/WMF.h b/dom/media/platforms/wmf/WMF.h index 394fb455ad..aa54f8e32f 100644 --- a/dom/media/platforms/wmf/WMF.h +++ b/dom/media/platforms/wmf/WMF.h @@ -18,6 +18,7 @@ which makes Windows Media Foundation unavailable. #undef WINVER #define WINVER _WIN32_WINNT_WIN7 +#include #include #include #include diff --git a/embedding/components/printingui/win/nsPrintDialogUtil.cpp b/embedding/components/printingui/win/nsPrintDialogUtil.cpp index 896c58e856..5439c512b1 100644 --- a/embedding/components/printingui/win/nsPrintDialogUtil.cpp +++ b/embedding/components/printingui/win/nsPrintDialogUtil.cpp @@ -21,12 +21,6 @@ WIN_LIBS= \ ---------------------------------------------------------------------- */ #include "plstr.h" -#include -#include - -#include -#include - #include "nsIWebBrowserPrint.h" #include "nsString.h" #include "nsIServiceManager.h" @@ -43,7 +37,13 @@ WIN_LIBS= \ #include "nsCRT.h" #include "prenv.h" /* for PR_GetEnv */ +#include #include +#include + +#include +#include + #include // For Localization diff --git a/gfx/layers/d3d11/ReadbackManagerD3D11.h b/gfx/layers/d3d11/ReadbackManagerD3D11.h index d15346fd86..1a22680010 100644 --- a/gfx/layers/d3d11/ReadbackManagerD3D11.h +++ b/gfx/layers/d3d11/ReadbackManagerD3D11.h @@ -6,6 +6,7 @@ #ifndef GFX_READBACKMANAGERD3D11_H #define GFX_READBACKMANAGERD3D11_H +#include #include #include diff --git a/gfx/layers/d3d11/TextureD3D11.h b/gfx/layers/d3d11/TextureD3D11.h index 86db51df13..7681b91486 100644 --- a/gfx/layers/d3d11/TextureD3D11.h +++ b/gfx/layers/d3d11/TextureD3D11.h @@ -238,7 +238,7 @@ public: virtual ID3D11ShaderResourceView* GetShaderResourceView() override; // Returns nullptr if this texture was created by a DXGI TextureHost. - virtual DataTextureSource* AsDataTextureSource() override { return mAllowTextureUploads ? this : false; } + virtual DataTextureSource* AsDataTextureSource() override { return mAllowTextureUploads ? this : nullptr; } virtual void DeallocateDeviceData() override { mTexture = nullptr; } diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp index 92536c36e6..ef42864edc 100644 --- a/js/src/jsmath.cpp +++ b/js/src/jsmath.cpp @@ -709,7 +709,11 @@ GenerateRandomSeed() { uint64_t seed = 0; -#if defined(__linux__) +#if defined(XP_WIN) + if (SystemFunction036(&seed, sizeof(seed))) + return seed; + +#elif defined(__linux__) // Linux does not provide arc4random(), so use /dev/urandom. int fd = open("/dev/urandom", O_RDONLY); if (fd >= 0) { @@ -732,8 +736,10 @@ GenerateRandomSeed() #else // Generic fallback - uint32_t lo = random(); - uint32_t hi = random(); + uint32_t lo = 0; + uint32_t hi = 0; + lo = static_cast(rand()); + hi = static_cast(rand()); return (static_cast(hi) << 32) | lo; #endif } diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp index b35316a9f5..58157d8883 100644 --- a/layout/base/nsRefreshDriver.cpp +++ b/layout/base/nsRefreshDriver.cpp @@ -17,6 +17,7 @@ */ #ifdef XP_WIN +#include #include // mmsystem isn't part of WIN32_LEAN_AND_MEAN, so we have // to manually include it diff --git a/media/libstagefright/ports/win32/include/pthread.h b/media/libstagefright/ports/win32/include/pthread.h index 1aa4e70323..c31d9a7e54 100644 --- a/media/libstagefright/ports/win32/include/pthread.h +++ b/media/libstagefright/ports/win32/include/pthread.h @@ -1 +1,13 @@ -// Intentionally left blank +/* + * Stagefright's win32 include path shadows the toolchain . + * On MinGW we need the real pthread declarations for libstdc++ gthr. + */ + +#ifndef stagefright_win32_pthread_h +#define stagefright_win32_pthread_h + +#if defined(__MINGW32__) +# include_next +#endif + +#endif diff --git a/media/mtransport/nrinterfaceprioritizer.cpp b/media/mtransport/nrinterfaceprioritizer.cpp index 90ab1bc60e..47760a3997 100644 --- a/media/mtransport/nrinterfaceprioritizer.cpp +++ b/media/mtransport/nrinterfaceprioritizer.cpp @@ -43,9 +43,9 @@ public: } addr_ = buf; - is_vpn_ = (local_addr.interface.type & NR_INTERFACE_TYPE_VPN) != 0 ? 1 : 0; - estimated_speed_ = local_addr.interface.estimated_speed; - type_preference_ = GetNetworkTypePreference(local_addr.interface.type); + is_vpn_ = (local_addr.if_info.type & NR_INTERFACE_TYPE_VPN) != 0 ? 1 : 0; + estimated_speed_ = local_addr.if_info.estimated_speed; + type_preference_ = GetNetworkTypePreference(local_addr.if_info.type); ip_version_ = local_addr.addr.ip_version; return true; } diff --git a/media/mtransport/test/ice_unittest.cpp b/media/mtransport/test/ice_unittest.cpp index c20cfd271c..0a75bd0834 100644 --- a/media/mtransport/test/ice_unittest.cpp +++ b/media/mtransport/test/ice_unittest.cpp @@ -1996,8 +1996,8 @@ class WebRtcIcePrioritizerTest : public StunTest { std::string str_addr = "10.0.0." + num; std::string ifname = "eth" + num; nr_local_addr local_addr; - local_addr.interface.type = type; - local_addr.interface.estimated_speed = estimated_speed; + local_addr.if_info.type = type; + local_addr.if_info.estimated_speed = estimated_speed; int r = nr_str_port_to_transport_addr(str_addr.c_str(), 0, IPPROTO_UDP, &(local_addr.addr)); diff --git a/media/mtransport/third_party/nICEr/src/net/local_addr.c b/media/mtransport/third_party/nICEr/src/net/local_addr.c index c251f2215d..23777e1480 100644 --- a/media/mtransport/third_party/nICEr/src/net/local_addr.c +++ b/media/mtransport/third_party/nICEr/src/net/local_addr.c @@ -40,13 +40,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. int nr_local_addr_copy(nr_local_addr *to, nr_local_addr *from) { nr_transport_addr_copy(&(to->addr), &(from->addr)); - to->interface = from->interface; + to->if_info = from->if_info; return(0); } int nr_local_addr_fmt_info_string(nr_local_addr *addr, char *buf, int len) { - int addr_type = addr->interface.type; + int addr_type = addr->if_info.type; const char *vpn = (addr_type & NR_INTERFACE_TYPE_VPN) ? "VPN on " : ""; const char *type = (addr_type & NR_INTERFACE_TYPE_WIRED) ? "wired" : @@ -55,7 +55,7 @@ int nr_local_addr_fmt_info_string(nr_local_addr *addr, char *buf, int len) "unknown"; snprintf(buf, len, "%s%s, estimated speed: %d kbps", - vpn, type, addr->interface.estimated_speed); + vpn, type, addr->if_info.estimated_speed); buf[len - 1] = '\0'; return (0); } diff --git a/media/mtransport/third_party/nICEr/src/net/local_addr.h b/media/mtransport/third_party/nICEr/src/net/local_addr.h index 90e538856e..18d80a4551 100644 --- a/media/mtransport/third_party/nICEr/src/net/local_addr.h +++ b/media/mtransport/third_party/nICEr/src/net/local_addr.h @@ -50,7 +50,7 @@ typedef struct nr_interface_ { typedef struct nr_local_addr_ { nr_transport_addr addr; - nr_interface interface; + nr_interface if_info; } nr_local_addr; int nr_local_addr_copy(nr_local_addr *to, nr_local_addr *from); diff --git a/media/mtransport/third_party/nICEr/src/stun/addrs.c b/media/mtransport/third_party/nICEr/src/stun/addrs.c index c90191f73d..3d6a16eb34 100644 --- a/media/mtransport/third_party/nICEr/src/stun/addrs.c +++ b/media/mtransport/third_party/nICEr/src/stun/addrs.c @@ -220,18 +220,18 @@ stun_get_win32_addrs(nr_local_addr addrs[], int maxaddrs, int *count) strlcpy(addrs[n].addr.ifname, hex_hashed_ifname, sizeof(addrs[n].addr.ifname)); if (tmpAddress->IfType == IF_TYPE_ETHERNET_CSMACD) { - addrs[n].interface.type = NR_INTERFACE_TYPE_WIRED; + addrs[n].if_info.type = NR_INTERFACE_TYPE_WIRED; } else if (tmpAddress->IfType == IF_TYPE_IEEE80211) { /* Note: this only works for >= Win Vista */ - addrs[n].interface.type = NR_INTERFACE_TYPE_WIFI; + addrs[n].if_info.type = NR_INTERFACE_TYPE_WIFI; } else { - addrs[n].interface.type = NR_INTERFACE_TYPE_UNKNOWN; + addrs[n].if_info.type = NR_INTERFACE_TYPE_UNKNOWN; } #if (_WIN32_WINNT >= 0x0600) /* Note: only >= Vista provide link speed information */ - addrs[n].interface.estimated_speed = tmpAddress->TransmitLinkSpeed / 1000; + addrs[n].if_info.estimated_speed = tmpAddress->TransmitLinkSpeed / 1000; #else - addrs[n].interface.estimated_speed = 0; + addrs[n].if_info.estimated_speed = 0; #endif if (++n >= maxaddrs) goto done; @@ -300,11 +300,11 @@ stun_getifaddrs(nr_local_addr addrs[], int maxaddrs, int *count) { /* For wireless network, we won't get ethtool, it's a wired * connection */ - addrs[*count].interface.type = NR_INTERFACE_TYPE_WIRED; + addrs[*count].if_info.type = NR_INTERFACE_TYPE_WIRED; #ifdef DONT_HAVE_ETHTOOL_SPEED_HI - addrs[*count].interface.estimated_speed = ecmd.speed; + addrs[*count].if_info.estimated_speed = ecmd.speed; #else - addrs[*count].interface.estimated_speed = ((ecmd.speed_hi << 16) | ecmd.speed) * 1000; + addrs[*count].if_info.estimated_speed = ((ecmd.speed_hi << 16) | ecmd.speed) * 1000; #endif } @@ -312,20 +312,20 @@ stun_getifaddrs(nr_local_addr addrs[], int maxaddrs, int *count) e = ioctl(s, SIOCGIWRATE, &wrq); if (e == 0) { - addrs[*count].interface.type = NR_INTERFACE_TYPE_WIFI; - addrs[*count].interface.estimated_speed = wrq.u.bitrate.value / 1000; + addrs[*count].if_info.type = NR_INTERFACE_TYPE_WIFI; + addrs[*count].if_info.estimated_speed = wrq.u.bitrate.value / 1000; } close(s); if (if_addr->ifa_flags & IFF_POINTOPOINT) { - addrs[*count].interface.type = NR_INTERFACE_TYPE_UNKNOWN | NR_INTERFACE_TYPE_VPN; + addrs[*count].if_info.type = NR_INTERFACE_TYPE_UNKNOWN | NR_INTERFACE_TYPE_VPN; /* TODO (Bug 896913): find backend network type of this VPN */ } #else - addrs[*count].interface.type = NR_INTERFACE_TYPE_UNKNOWN; - addrs[*count].interface.estimated_speed = 0; + addrs[*count].if_info.type = NR_INTERFACE_TYPE_UNKNOWN; + addrs[*count].if_info.estimated_speed = 0; #endif strlcpy(addrs[*count].addr.ifname, if_addr->ifa_name, sizeof(addrs[*count].addr.ifname)); ++(*count); diff --git a/media/webrtc/trunk/webrtc/base/platform_thread.cc b/media/webrtc/trunk/webrtc/base/platform_thread.cc index 0a394331ff..398617f66f 100644 --- a/media/webrtc/trunk/webrtc/base/platform_thread.cc +++ b/media/webrtc/trunk/webrtc/base/platform_thread.cc @@ -73,11 +73,17 @@ void SetCurrentThreadName(const char* name) { DWORD dwFlags; } threadname_info = {0x1000, name, static_cast(-1), 0}; +#if defined(_MSC_VER) __try { ::RaiseException(0x406D1388, 0, sizeof(threadname_info) / sizeof(DWORD), reinterpret_cast(&threadname_info)); } __except (EXCEPTION_EXECUTE_HANDLER) { } +#else + // MinGW does not support MSVC's __try/__except syntax. + ::RaiseException(0x406D1388, 0, sizeof(threadname_info) / sizeof(DWORD), + reinterpret_cast(&threadname_info)); +#endif #elif defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID) prctl(PR_SET_NAME, reinterpret_cast(name)); #elif defined(WEBRTC_MAC) || defined(WEBRTC_IOS) diff --git a/media/webrtc/trunk/webrtc/base/proxydetect.cc b/media/webrtc/trunk/webrtc/base/proxydetect.cc index 30959ca1d3..6e38f4a64b 100644 --- a/media/webrtc/trunk/webrtc/base/proxydetect.cc +++ b/media/webrtc/trunk/webrtc/base/proxydetect.cc @@ -605,7 +605,7 @@ BOOL MyWinHttpGetProxyForUrl(pfnWinHttpGetProxyForUrl pWHGPFU, // error. BOOL success = FALSE; -#if (_HAS_EXCEPTIONS == 0) +#if (_HAS_EXCEPTIONS == 0) && defined(_MSC_VER) __try { success = pWHGPFU(hWinHttp, url, options, info); } __except(EXCEPTION_EXECUTE_HANDLER) { diff --git a/media/webrtc/trunk/webrtc/modules/video_capture/windows/video_capture_ds.h b/media/webrtc/trunk/webrtc/modules/video_capture/windows/video_capture_ds.h index ab4f69157b..5fe56c9013 100644 --- a/media/webrtc/trunk/webrtc/modules/video_capture/windows/video_capture_ds.h +++ b/media/webrtc/trunk/webrtc/modules/video_capture/windows/video_capture_ds.h @@ -60,7 +60,7 @@ protected: int32_t capabilityIndex); int32_t DisconnectGraph(); - HRESULT VideoCaptureDS::ConnectDVCamera(); + HRESULT ConnectDVCamera(); DeviceInfoDS _dsInfo; VideoCaptureCapability _activeCapability; diff --git a/media/webrtc/trunk/webrtc/test/testsupport/fileutils.cc b/media/webrtc/trunk/webrtc/test/testsupport/fileutils.cc index 15abf5c517..af389272bd 100644 --- a/media/webrtc/trunk/webrtc/test/testsupport/fileutils.cc +++ b/media/webrtc/trunk/webrtc/test/testsupport/fileutils.cc @@ -12,6 +12,8 @@ #include +#include + #ifdef WIN32 #include #include @@ -33,7 +35,6 @@ #endif #include -#include #include #include "webrtc/typedefs.h" // For architecture defines diff --git a/memory/mozjemalloc/jemalloc.c b/memory/mozjemalloc/jemalloc.c index f4a9fd5d75..7b42753b63 100644 --- a/memory/mozjemalloc/jemalloc.c +++ b/memory/mozjemalloc/jemalloc.c @@ -212,6 +212,7 @@ static unsigned long tlsIndex = 0xffffffff; #define _pthread_self() __threadid() /* use MSVC intrinsics */ +#if defined(_MSC_VER) #pragma intrinsic(_BitScanForward) static __forceinline int ffs(int x) @@ -223,6 +224,16 @@ ffs(int x) return (0); } +#else +static inline int +ffs(int x) +{ + if (x == 0) + return (0); + + return (__builtin_ctz((unsigned int)x) + 1); +} +#endif /* Implement getenv without using malloc */ static char mozillaMallocOptionsBuf[64]; @@ -243,11 +254,13 @@ typedef unsigned char uint8_t; typedef unsigned uint32_t; typedef unsigned long long uint64_t; typedef unsigned long long uintmax_t; +#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) #if defined(_WIN64) typedef long long ssize_t; #else typedef long ssize_t; #endif +#endif #define MALLOC_DECOMMIT #endif diff --git a/modules/zlib/src/chunkcopy.h b/modules/zlib/src/chunkcopy.h index 70a5686008..2c73b14e9f 100644 --- a/modules/zlib/src/chunkcopy.h +++ b/modules/zlib/src/chunkcopy.h @@ -36,6 +36,12 @@ typedef __m128i z_vec128i_t; #error chunkcopy.h inflate chunk SIMD is not defined for your build target #endif +#if defined(_MSC_VER) +#define Z_ALIGN16(type, name) __declspec(align(16)) type name +#else +#define Z_ALIGN16(type, name) type name __attribute__((aligned(16))) +#endif + #ifdef _MSC_VER #if _MSC_VER < 1900 #define inline @@ -222,7 +228,7 @@ static inline z_vec128i_t v_load64_dup(const void* src) { #if 0//def _WIN64 return _mm_set1_epi64x(i64); #else - _declspec(align(16)) uint64_t temp[2] = {i64, i64}; + Z_ALIGN16(uint64_t, temp[2]) = {i64, i64}; return _mm_load_si128((const __m128i*)temp); #endif } diff --git a/modules/zlib/src/moz.build b/modules/zlib/src/moz.build index 2634a3bd9f..324ac6cb17 100644 --- a/modules/zlib/src/moz.build +++ b/modules/zlib/src/moz.build @@ -88,4 +88,8 @@ else: 'inflate.c', ] +if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['GNU_CC']: + SOURCES['crc32_simd.c'].flags += ['-msse4.2', '-mpclmul'] + SOURCES['crc_folding.c'].flags += ['-msse4.2', '-mpclmul'] + diff --git a/mozconfigs/uxp-win32-mingw32 b/mozconfigs/uxp-win32-mingw32 new file mode 100644 index 0000000000..d81cb1b072 --- /dev/null +++ b/mozconfigs/uxp-win32-mingw32 @@ -0,0 +1,85 @@ +## UXP mozconfig thing based off roytam1's config and r3dfox config + +##Uncomment PGO for release build + +# 16 jobs for 16 cores +mk_add_options MOZ_MAKE_FLAGS="-j6" + +# x86 build +ac_add_options --host=i686-pc-mingw32 +ac_add_options --target=i686-pc-mingw32 +WIN32_REDIST_DIR=$VCINSTALLDIR/Redist/MSVC/14.16.27012/x86 +WIN_UCRT_REDIST_DIR=$WINDOWSSDKDIR/Redist/10.0.19041.0/ucrt/DLLs/r86 + +CC=gcc +CXX=g++ +LD=g++ +AR=ar +AS=as +RANLIB=ranlib + +# Build only Hydra +ac_add_options --enable-application=basilisk +ac_add_options --disable-artifact-builds + +# Updater stuffs +ac_add_options --disable-updater +# Enable if update server and signatures are figured out +#ac_add_options --enable-nss-mar + +# Optimization settings +ac_add_options --disable-accessibility +ac_add_options --disable-debug +ac_add_options --disable-debug-js-modules +ac_add_options --disable-debug-symbols +ac_add_options --disable-tests +ac_add_options --enable-devtools +#ac_add_options --enable-install-strip +ac_add_options --enable-jemalloc +ac_add_options --enable-js-lto +ac_add_options --enable-optimize="-O2" +ac_add_options --enable-phoenix-extensions +ac_add_options --enable-release +ac_add_options --enable-shared-js +ac_add_options --enable-strip +MOZ_OPTIMIZE=1 +export MOZ_OPTIMIZE=1 +mk_add_options MOZ_OPTIMIZE=1 +export MOZILLA_OFFICIAL=1 +export STRIP_FLAGS="--strip-debug --strip-unneeded" + +# Media settings +ac_add_options --enable-av1 +ac_add_options --enable-jxl +ac_add_options --enable-raw +ac_add_options --disable-webrtc + + +# Client settings +ac_add_options --disable-crashreporter +ac_add_options --disable-eme +ac_add_options --disable-maintenance-service +ac_add_options --disable-parental-controls +mk_add_options MOZ_SERVICES_HEALTHREPORT=0 +export CROSS_COMPILE=0 +export MOZ_CRASHREPORTER=0 +export MOZ_DATA_REPORTING=0 +export MOZ_INCLUDE_SOURCE_INFO=1 +export MOZ_REQUIRE_SIGNING= +export MOZ_SOURCE_CHANGESET=iloveneedingtobodgechangesetfornoreason +export MOZ_TELEMETRY_REPORTING= +export MOZ_PACKAGE_JSSHELL=1 + +# Set -Copt-level=3 +export OPT_LEVEL="3" +ac_add_options OPT_LEVEL="3" + +# Enable LTO +export MOZ_LTO=1 +ac_add_options MOZ_LTO=1 + +# Stops the compiler from bitching +export CFLAGS="-O2 -std=gnu++17" +export CPPFLAGS="-O2 -std=gnu++17" +export CXXFLAGS="-O2 -std=gnu++17" +export VERBOSE=0 \ No newline at end of file diff --git a/mozconfigs/uxp-win32 b/mozconfigs/uxp-win32-msvc similarity index 100% rename from mozconfigs/uxp-win32 rename to mozconfigs/uxp-win32-msvc diff --git a/netwerk/base/NetworkInfoServiceWindows.cpp b/netwerk/base/NetworkInfoServiceWindows.cpp index 533e1a67b2..b6f6c00364 100644 --- a/netwerk/base/NetworkInfoServiceWindows.cpp +++ b/netwerk/base/NetworkInfoServiceWindows.cpp @@ -3,11 +3,12 @@ * 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 #include #include #include -#include "mozilla/UniquePtr.h" +#include "mozilla/UniquePtrExtensions.h" #include "NetworkInfoServiceImpl.h" @@ -17,7 +18,7 @@ namespace net { nsresult DoListAddresses(AddrMapType& aAddrMap) { - UniquePtr ipAddrTable; + UniqueFreePtr ipAddrTable; DWORD size = sizeof(MIB_IPADDRTABLE); ipAddrTable.reset((MIB_IPADDRTABLE*) malloc(size)); diff --git a/netwerk/base/nsNetworkInfoService.cpp b/netwerk/base/nsNetworkInfoService.cpp index 2d63ae94e6..21963cf5ec 100644 --- a/netwerk/base/nsNetworkInfoService.cpp +++ b/netwerk/base/nsNetworkInfoService.cpp @@ -6,6 +6,7 @@ #if defined(XP_MACOSX) || defined(XP_LINUX) #include #elif defined(XP_WIN) +#include #include #endif diff --git a/netwerk/system/win32/nsNotifyAddrListener.cpp b/netwerk/system/win32/nsNotifyAddrListener.cpp index 58f4345ef8..0832fff860 100644 --- a/netwerk/system/win32/nsNotifyAddrListener.cpp +++ b/netwerk/system/win32/nsNotifyAddrListener.cpp @@ -8,6 +8,7 @@ // inet_ntop() doesn't exist on Windows XP. #define _WINSOCK_DEPRECATED_NO_WARNINGS +#include #include #include #include diff --git a/python/mozbuild/mozbuild/backend/visualstudio.py b/python/mozbuild/mozbuild/backend/visualstudio.py index 86e97d13d3..1cb01c5f89 100644 --- a/python/mozbuild/mozbuild/backend/visualstudio.py +++ b/python/mozbuild/mozbuild/backend/visualstudio.py @@ -66,7 +66,7 @@ class VisualStudioBackend(CommonBackend): self._out_dir = os.path.join(self.environment.topobjdir, 'msvc') self._projsubdir = 'projects' - self._version = self.environment.substs.get('MSVS_VERSION', '2015') + self._version = self.environment.substs.get('MSVS_VERSION') self._paths_to_sources = {} self._paths_to_includes = {} @@ -132,6 +132,12 @@ class VisualStudioBackend(CommonBackend): out_dir = self._out_dir out_proj_dir = os.path.join(self._out_dir, self._projsubdir) + # If we do not have an MSVC version, we should not generate Visual + # Studio projects. + version = self._version + if not version: + return + projects = self._write_projects_for_sources(self._libs_to_paths, "library", out_proj_dir) projects.update(self._write_projects_for_sources(self._progs_to_paths, diff --git a/toolkit/mozapps/update/common/updatecommon.cpp b/toolkit/mozapps/update/common/updatecommon.cpp index aff7d72602..6d86022d26 100644 --- a/toolkit/mozapps/update/common/updatecommon.cpp +++ b/toolkit/mozapps/update/common/updatecommon.cpp @@ -3,13 +3,13 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #if defined(XP_WIN) +#include #include #endif #include #include -#include #include #include "updatecommon.h" diff --git a/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp b/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp index bb5f72b691..26b724d3eb 100644 --- a/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp +++ b/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp @@ -3,6 +3,7 @@ * 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 #include #include #include diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index c11ca26c40..673f663b7b 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -93,6 +93,7 @@ #ifdef XP_WIN #include "nsIWinAppHelper.h" +#include #include #include #include @@ -136,7 +137,6 @@ #include "mozilla/StartupTimeline.h" #include "mozilla/LateWriteChecks.h" -#include #include #ifdef XP_UNIX diff --git a/toolkit/xre/nsNativeAppSupportWin.cpp b/toolkit/xre/nsNativeAppSupportWin.cpp index 0605ccb5af..7d046f977e 100644 --- a/toolkit/xre/nsNativeAppSupportWin.cpp +++ b/toolkit/xre/nsNativeAppSupportWin.cpp @@ -41,11 +41,11 @@ #include "nsNativeCharsetUtils.h" #include "nsIAppStartup.h" +#include +#include #include #include #include -#include -#include #include #include #include diff --git a/widget/windows/AudioSession.cpp b/widget/windows/AudioSession.cpp index 11e5ba50cd..084fd3d7dd 100644 --- a/widget/windows/AudioSession.cpp +++ b/widget/windows/AudioSession.cpp @@ -4,6 +4,7 @@ * 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 #include #include #include diff --git a/widget/windows/JumpListBuilder.h b/widget/windows/JumpListBuilder.h index 553ff765d0..4e64d1cb2f 100644 --- a/widget/windows/JumpListBuilder.h +++ b/widget/windows/JumpListBuilder.h @@ -6,6 +6,8 @@ #ifndef __JumpListBuilder_h__ #define __JumpListBuilder_h__ +#include + #include #undef NTDDI_VERSION diff --git a/widget/windows/TaskbarPreview.cpp b/widget/windows/TaskbarPreview.cpp index ec182d8ae0..0a54d7ade2 100644 --- a/widget/windows/TaskbarPreview.cpp +++ b/widget/windows/TaskbarPreview.cpp @@ -4,6 +4,7 @@ * 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 #include "TaskbarPreview.h" #include #include diff --git a/widget/windows/WinTaskbar.cpp b/widget/windows/WinTaskbar.cpp index 03a525d538..02cb74eaf9 100644 --- a/widget/windows/WinTaskbar.cpp +++ b/widget/windows/WinTaskbar.cpp @@ -4,6 +4,7 @@ * 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 #include "WinTaskbar.h" #include "TaskbarPreview.h" #include diff --git a/widget/windows/WinUtils.h b/widget/windows/WinUtils.h index 5fa2dbd9f7..3dda5e4088 100644 --- a/widget/windows/WinUtils.h +++ b/widget/windows/WinUtils.h @@ -39,7 +39,7 @@ // Starting with version 10.0.22621.0 of the Windows SDK the AR_STATE enum and // types are only defined when building for Windows 8 instead of Windows 7. -#if (WDK_NTDDI_VERSION >= 0x0A00000C) && (WINVER < 0x0602) +#if (WDK_NTDDI_VERSION >= 0x0A00000C) && (WINVER < 0x0602) && !defined(MOZ_AR_STATE_DEFINED) enum tagAR_STATE { AR_ENABLED = 0x0, @@ -57,6 +57,8 @@ typedef enum tagAR_STATE AR_STATE; using PAR_STATE = enum tagAR_STATE*; +#define MOZ_AR_STATE_DEFINED 1 + #endif // (WDK_NTDDI_VERSION >= 0x0A00000C) && (WINVER < 0x0602) /** diff --git a/widget/windows/WindowsUIUtils.cpp b/widget/windows/WindowsUIUtils.cpp index 78ac39b93c..0f95c33e8b 100644 --- a/widget/windows/WindowsUIUtils.cpp +++ b/widget/windows/WindowsUIUtils.cpp @@ -3,6 +3,7 @@ * 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 #include #include #include "mozwrlbase.h" diff --git a/widget/windows/nsFilePicker.h b/widget/windows/nsFilePicker.h index 0a2e01b90b..737cfcce8f 100644 --- a/widget/windows/nsFilePicker.h +++ b/widget/windows/nsFilePicker.h @@ -7,6 +7,7 @@ #ifndef nsFilePicker_h__ #define nsFilePicker_h__ +#include #include // For Vista IFileDialog interfaces which aren't exposed diff --git a/widget/windows/nsLookAndFeel.h b/widget/windows/nsLookAndFeel.h index ecc1e83045..6fb489ac8e 100644 --- a/widget/windows/nsLookAndFeel.h +++ b/widget/windows/nsLookAndFeel.h @@ -42,6 +42,7 @@ typedef enum _AR_STATE AR_DOCKED = 0x40, AR_LAPTOP = 0x80 } AR_STATE, *PAR_STATE; +#define MOZ_AR_STATE_DEFINED 1 #endif class nsLookAndFeel: public nsXPLookAndFeel { diff --git a/xpcom/base/nsSetDllDirectory.h b/xpcom/base/nsSetDllDirectory.h index 5fae3a895e..2748a6786d 100644 --- a/xpcom/base/nsSetDllDirectory.h +++ b/xpcom/base/nsSetDllDirectory.h @@ -10,9 +10,9 @@ #error This file only makes sense on Windows. #endif +#include #include #include -#include namespace mozilla { diff --git a/xpcom/base/nsUUIDGenerator.cpp b/xpcom/base/nsUUIDGenerator.cpp index 2f9fd257e2..55a8715b19 100644 --- a/xpcom/base/nsUUIDGenerator.cpp +++ b/xpcom/base/nsUUIDGenerator.cpp @@ -4,6 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #if defined(XP_WIN) +#include #include #include #elif defined(XP_MACOSX) diff --git a/xpcom/build/perfprobe.cpp b/xpcom/build/perfprobe.cpp index 5a52e3be24..f38a624dea 100644 --- a/xpcom/build/perfprobe.cpp +++ b/xpcom/build/perfprobe.cpp @@ -6,6 +6,7 @@ /***************************** Windows implementation of probes, using xperf *****************************/ +#include #include #include #include diff --git a/xpcom/ds/nsWindowsRegKey.cpp b/xpcom/ds/nsWindowsRegKey.cpp index 9e1b5a96ac..ac276dba63 100644 --- a/xpcom/ds/nsWindowsRegKey.cpp +++ b/xpcom/ds/nsWindowsRegKey.cpp @@ -3,9 +3,9 @@ * 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 #include #include -#include #include "nsWindowsRegKey.h" #include "nsString.h" #include "nsCOMPtr.h" diff --git a/xpcom/io/FileUtilsWin.cpp b/xpcom/io/FileUtilsWin.cpp index 98173b6bad..b2e083e47a 100644 --- a/xpcom/io/FileUtilsWin.cpp +++ b/xpcom/io/FileUtilsWin.cpp @@ -4,7 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "FileUtilsWin.h" - +#include #include #include diff --git a/xpcom/io/FileUtilsWin.h b/xpcom/io/FileUtilsWin.h index 8056f5a942..f9b1c4e329 100644 --- a/xpcom/io/FileUtilsWin.h +++ b/xpcom/io/FileUtilsWin.h @@ -6,6 +6,7 @@ #ifndef mozilla_FileUtilsWin_h #define mozilla_FileUtilsWin_h +#include #include #include "mozilla/Scoped.h" diff --git a/xpcom/io/SpecialSystemDirectory.cpp b/xpcom/io/SpecialSystemDirectory.cpp index 67e7f0059d..8f7564dfed 100644 --- a/xpcom/io/SpecialSystemDirectory.cpp +++ b/xpcom/io/SpecialSystemDirectory.cpp @@ -3,6 +3,7 @@ * 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 #include "SpecialSystemDirectory.h" #include "nsString.h" #include "nsDependentString.h" @@ -10,9 +11,9 @@ #if defined(XP_WIN) +#include #include #include -#include #include #include #include diff --git a/xpcom/io/nsAppFileLocationProvider.cpp b/xpcom/io/nsAppFileLocationProvider.cpp index d5569985cf..d723bb55eb 100644 --- a/xpcom/io/nsAppFileLocationProvider.cpp +++ b/xpcom/io/nsAppFileLocationProvider.cpp @@ -19,11 +19,11 @@ #include #include "nsILocalFileMac.h" #elif defined(XP_WIN) +#include #include #include #elif defined(XP_UNIX) #include -#include #include #endif diff --git a/xpcom/io/nsDirectoryService.cpp b/xpcom/io/nsDirectoryService.cpp index dae8521485..8a2135bfdb 100644 --- a/xpcom/io/nsDirectoryService.cpp +++ b/xpcom/io/nsDirectoryService.cpp @@ -19,9 +19,9 @@ #include "nsIStringEnumerator.h" #if defined(XP_WIN) +#include #include #include -#include #include #elif defined(XP_UNIX) #include diff --git a/xpcom/io/nsLocalFileWin.cpp b/xpcom/io/nsLocalFileWin.cpp index 0aa430d9dd..8fb6f49fd3 100644 --- a/xpcom/io/nsLocalFileWin.cpp +++ b/xpcom/io/nsLocalFileWin.cpp @@ -29,16 +29,16 @@ #include "nsReadableUtils.h" #include -#include +#include #include #include +#include #include "shellapi.h" #include "shlguid.h" #include #include -#include #include #include "nsXPIDLString.h" diff --git a/xpcom/io/nsNativeCharsetUtils.cpp b/xpcom/io/nsNativeCharsetUtils.cpp index 3ed20d7f04..7bc97a9154 100644 --- a/xpcom/io/nsNativeCharsetUtils.cpp +++ b/xpcom/io/nsNativeCharsetUtils.cpp @@ -9,7 +9,7 @@ // Windows //----------------------------------------------------------------------------- #if defined(XP_WIN) - +#include #include #include "nsString.h" #include "nsAString.h" diff --git a/xpcom/threads/nsTimerImpl.cpp b/xpcom/threads/nsTimerImpl.cpp index 2a3531a858..a8c2a19db7 100644 --- a/xpcom/threads/nsTimerImpl.cpp +++ b/xpcom/threads/nsTimerImpl.cpp @@ -519,14 +519,16 @@ nsTimerImpl::Fire(int32_t aGeneration) this, (TimeStamp::Now() - now).ToMilliseconds())); } -#if defined(HAVE_DLADDR) && defined(HAVE___CXA_DEMANGLE) +#if defined(HAVE_DLADDR) && defined(HAVE___CXA_DEMANGLE) && !defined(XP_WIN) #define USE_DLADDR 1 #endif #ifdef USE_DLADDR +#if !defined(XP_WIN) #include #include #endif +#endif // See the big comment above GetTimerFiringsLog() to understand this code. void diff --git a/xpcom/windbgdlg/windbgdlg.cpp b/xpcom/windbgdlg/windbgdlg.cpp index 9153dc006f..843864901d 100644 --- a/xpcom/windbgdlg/windbgdlg.cpp +++ b/xpcom/windbgdlg/windbgdlg.cpp @@ -4,8 +4,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* Windows only app to show a modal debug dialog - launched by nsDebug.cpp */ -#include #include +#include #ifdef _MSC_VER #include #endif