Finally finish with MinGW building (linking still has some issues shush)

This commit is contained in:
wuggy 2026-04-18 01:02:51 -07:00
commit 854f39b4ab
32 changed files with 104 additions and 19 deletions

View file

@ -1,7 +1,7 @@
/* 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 <stdlib.h>
#include "nsIEHistoryEnumerator.h"
#include <urlhist.h>

View file

@ -4,7 +4,7 @@
#ifndef iehistoryenumerator___h___
#define iehistoryenumerator___h___
#include <stdlib.h>
#include <urlhist.h>
#include "mozilla/Attributes.h"

View file

@ -70,7 +70,8 @@ if CONFIG['MOZ_DEBUG']:
if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['MOZ_MEMORY']:
DEFINES['HAVE_MALLOC_USABLE_SIZE'] = True
DEFINES['SQLITE_WITHOUT_MSIZE'] = True
CFLAGS += ['-wd4013']
if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
CFLAGS += ['-wd4013']
# Omit unused functions to save some library footprint.
DEFINES['SQLITE_OMIT_DEPRECATED'] = True

View file

@ -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 <stdlib.h>
#include "mozilla/PluginPRLibrary.h"
#include "nsNPAPIPluginInstance.h"

View file

@ -121,8 +121,8 @@ TranslateVersionStr(const WCHAR* szVersion, verBlock *vbVersion)
// wcstok that is generally not thread-safe. For our purposes here, it works
// fine, though.
auto wcstok = [](wchar_t* strToken, const wchar_t* strDelimit,
wchar_t** /*ctx*/) {
return ::std::wcstok(strToken, strDelimit);
wchar_t** ctx) {
return ::wcstok(strToken, strDelimit, ctx);
};
#endif

View file

@ -34,6 +34,7 @@
#endif // defined(XP_MACOSX)
#if defined(XP_WIN)
#include <stdlib.h>
#include <windows.h>
#include <accctrl.h>

View file

@ -6,6 +6,7 @@
#ifndef MOZILLA_GFX_EXTENDINPUTEFFECTD2D1_H_
#define MOZILLA_GFX_EXTENDINPUTEFFECTD2D1_H_
#include <stdlib.h>
#include <d2d1_1.h>
#include <d2d1effectauthor.h>
#include <d2d1effecthelpers.h>

View file

@ -5,7 +5,7 @@
#ifndef mozilla_gfx_NativeFontResourceDWrite_h
#define mozilla_gfx_NativeFontResourceDWrite_h
#include <stdlib.h>
#include <dwrite.h>
#include "2D.h"

View file

@ -5,7 +5,7 @@
#ifndef mozilla_gfx_NativeFontResourceGDI_h
#define mozilla_gfx_NativeFontResourceGDI_h
#include <stdlib.h>
#include <windows.h>
#include "2D.h"

View file

@ -2,7 +2,7 @@
* 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 <stdlib.h>
#include "PathD2D.h"
#include "HelpersD2D.h"
#include <math.h>

View file

@ -5,7 +5,7 @@
#ifndef MOZILLA_GFX_PATHD2D_H_
#define MOZILLA_GFX_PATHD2D_H_
#include <stdlib.h>
#include <d2d1.h>
#include "2D.h"

View file

@ -5,7 +5,7 @@
#ifndef MOZILLA_GFX_RADIALGRADIENTEFFECTD2D1_H_
#define MOZILLA_GFX_RADIALGRADIENTEFFECTD2D1_H_
#include <stdlib.h>
#include <d2d1_1.h>
#include <d2d1effectauthor.h>
#include <d2d1effecthelpers.h>

View file

@ -5,7 +5,7 @@
#ifndef MOZILLA_GFX_SOURCESURFACED2D1_H_
#define MOZILLA_GFX_SOURCESURFACED2D1_H_
#include <stdlib.h>
#include "2D.h"
#include "HelpersD2D.h"
#include <vector>

View file

@ -5,7 +5,7 @@
#ifndef MOZILLA_GFX_SOURCESURFACESKIA_H_
#define MOZILLA_GFX_SOURCESURFACESKIA_H_
#include <stdlib.h>
#include "2D.h"
#include <vector>
#include "skia/include/core/SkCanvas.h"

View file

@ -8,6 +8,8 @@
#
# WARNING WARNING WARNING
#
DISABLE_STL_WRAPPING = True
UNIFIED_SOURCES += [
'src/common/angleutils.cpp',
'src/common/debug.cpp',

View file

@ -8,6 +8,8 @@
#
# WARNING WARNING WARNING
#
DISABLE_STL_WRAPPING = True
UNIFIED_SOURCES += [
'../common/angleutils.cpp',
'../common/debug.cpp',

View file

@ -8,6 +8,8 @@
#
# WARNING WARNING WARNING
#
DISABLE_STL_WRAPPING = True
UNIFIED_SOURCES += [
'entry_points_egl.cpp',
'entry_points_egl_ext.cpp',

View file

@ -13,7 +13,15 @@
#include <intrin.h>
static void cpuid (uint32_t abcd[4]) { __cpuid ((int*)abcd, 1); }
static void cpuid7(uint32_t abcd[4]) { __cpuidex((int*)abcd, 7, 0); }
static uint64_t xgetbv(uint32_t xcr) { return _xgetbv(xcr); }
static uint64_t xgetbv(uint32_t xcr) {
#if defined(__MINGW32__)
uint32_t eax, edx;
__asm__ __volatile__ ("xgetbv" : "=a"(eax), "=d"(edx) : "c"(xcr));
return (uint64_t)(edx) << 32 | eax;
#else
return _xgetbv(xcr);
#endif
}
#else
#include <cpuid.h>
#if !defined(__cpuid_count) // Old Mac Clang doesn't have this defined.

View file

@ -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 <stdlib.h>
#include <windows.h>
#include "nsMathUtils.h"

View file

@ -11,6 +11,7 @@
* XXX to get CAIRO_HAS_D2D_SURFACE, CAIRO_HAS_DWRITE_FONT
* and cairo_win32_scaled_font_select_font
*/
#include <stdlib.h>
#include "cairo-win32.h"
#include "gfxFontUtils.h"

View file

@ -41,7 +41,6 @@ av_fft_calc
av_fft_end
av_fft_init
av_fft_permute
av_fopen_utf8
av_free_packet
av_get_audio_frame_duration
av_get_audio_frame_duration2

View file

@ -5,7 +5,7 @@
* accompanying file LICENSE for details.
*/
#define NOMINMAX
#include <stdlib.h>
#include <initguid.h>
#include <windows.h>
#include <mmdeviceapi.h>

View file

@ -20,6 +20,10 @@
#include "cubeb/cubeb.h"
#include "cubeb-internal.h"
#if defined(__MINGW32__)
#define _snprintf_s(dest, size, count, ...) snprintf(dest, size, __VA_ARGS__)
#endif
/* This is missing from the MinGW headers. Use a safe fallback. */
#if !defined(MEMORY_ALLOCATION_ALIGNMENT)
#define MEMORY_ALLOCATION_ALIGNMENT 16

View file

@ -3,8 +3,9 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <mozilla/Assertions.h>
#include <stdlib.h>
/* Provide an abort function for use in jemalloc code */
extern "C" void moz_abort() {
MOZ_CRASH();
abort();
}

View file

@ -193,6 +193,10 @@
#include <windows.h>
#include <intrin.h>
#ifndef min
#define min(a, b) (((a) < (b)) ? (a) : (b))
#endif
#pragma warning( disable: 4267 4996 4146 )
#define bool BOOL

View file

@ -5,7 +5,7 @@
#ifndef nsDownloadScanner_h_
#define nsDownloadScanner_h_
#include <stdlib.h>
#ifdef WIN32_LEAN_AND_MEAN
#undef WIN32_LEAN_AND_MEAN
#endif

View file

@ -6,6 +6,7 @@
#ifndef ProfileUnlockerWin_h
#define ProfileUnlockerWin_h
#include <stdlib.h>
#include <windows.h>
#include <restartmanager.h>

View file

@ -2,7 +2,7 @@
/* 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 <stdlib.h>
#include "nspr.h"
#include "mozilla/BasicEvents.h"
#include "mozilla/EventDispatcher.h"

View file

@ -8,7 +8,7 @@
#ifndef nsDocLoader_h__
#define nsDocLoader_h__
#include <stdlib.h>
#include "nsIDocumentLoader.h"
#include "nsIWebProgress.h"
#include "nsIWebProgressListener.h"

View file

@ -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 <stdlib.h>
#include "nsURILoader.h"
#include "nsAutoPtr.h"
#include "nsIURIContentListener.h"

View file

@ -6,6 +6,7 @@
#ifndef nsURILoader_h__
#define nsURILoader_h__
#include <stdlib.h>
#include "nsCURILoader.h"
#include "nsISupportsUtils.h"
#include "nsCOMArray.h"

View file

@ -61,7 +61,34 @@ template<typename T>
class AbstractCanonical
{
public:
#if defined(__MINGW32__)
MOZ_NEVER_INLINE MozExternalRefCountType AddRef(void)
{
MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(AbstractCanonical)
MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");
nsrefcnt count = ++mRefCnt;
NS_LOG_ADDREF(this, count, "AbstractCanonical", sizeof(*this));
return (nsrefcnt) count;
}
MOZ_NEVER_INLINE MozExternalRefCountType Release(void)
{
MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");
nsrefcnt count = --mRefCnt;
NS_LOG_RELEASE(this, count, "AbstractCanonical");
if (count == 0) {
delete (this);
return 0;
}
return count;
}
typedef mozilla::TrueType HasThreadSafeRefCnt;
protected:
::mozilla::ThreadSafeAutoRefCnt mRefCnt;
public:
#else
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AbstractCanonical)
#endif
AbstractCanonical(AbstractThread* aThread) : mOwnerThread(aThread) {}
virtual void AddMirror(AbstractMirror<T>* aMirror) = 0;
virtual void RemoveMirror(AbstractMirror<T>* aMirror) = 0;
@ -82,7 +109,34 @@ template<typename T>
class AbstractMirror
{
public:
#if defined(__MINGW32__)
MOZ_NEVER_INLINE MozExternalRefCountType AddRef(void)
{
MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(AbstractMirror)
MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");
nsrefcnt count = ++mRefCnt;
NS_LOG_ADDREF(this, count, "AbstractMirror", sizeof(*this));
return (nsrefcnt) count;
}
MOZ_NEVER_INLINE MozExternalRefCountType Release(void)
{
MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");
nsrefcnt count = --mRefCnt;
NS_LOG_RELEASE(this, count, "AbstractMirror");
if (count == 0) {
delete (this);
return 0;
}
return count;
}
typedef mozilla::TrueType HasThreadSafeRefCnt;
protected:
::mozilla::ThreadSafeAutoRefCnt mRefCnt;
public:
#else
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AbstractMirror)
#endif
AbstractMirror(AbstractThread* aThread) : mOwnerThread(aThread) {}
virtual void UpdateValue(const T& aNewValue) = 0;
virtual void NotifyDisconnected() = 0;