Browse Source

contrib/mingw64: fix the DllMain signature declaration

It should be using an unsigned long, not an unsigned.
pull/162/head
Steve Lhomme 3 years ago
parent
commit
a4b4d938cc
  1. 33
      contrib/src/mingw64/0001-include-process-fix-bare-DllMain-_CRT_INIT-signature.patch
  2. 16
      contrib/src/mingw64/rules.mak

33
contrib/src/mingw64/0001-include-process-fix-bare-DllMain-_CRT_INIT-signature.patch

@ -0,0 +1,33 @@
From aa4e9797bac4b353ebfd6159e731e8347ea10f28 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Wed, 27 Sep 2023 13:53:54 +0200
Subject: [PATCH] include/process: fix bare DllMain/_CRT_INIT signature
The DWORD reason corresponds to an "unsigned long", not an "unsigned".
This is also how it's defined in the Windows SDK.
---
mingw-w64-headers/crt/process.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mingw-w64-headers/crt/process.h b/mingw-w64-headers/crt/process.h
index 08b73cf58..1ac39a064 100644
--- a/mingw-w64-headers/crt/process.h
+++ b/mingw-w64-headers/crt/process.h
@@ -138,10 +138,10 @@ extern "C" {
WINBOOL WINAPI _wCRT_INIT(HANDLE _HDllHandle,DWORD _Reason,LPVOID _Reserved);
extern WINBOOL (WINAPI *const _pRawDllMain)(HANDLE,DWORD,LPVOID);
#else
- int __stdcall DllMain(void *_HDllHandle,unsigned _Reason,void *_Reserved);
- int __stdcall _CRT_INIT(void *_HDllHandle,unsigned _Reason,void *_Reserved);
- int __stdcall _wCRT_INIT(void *_HDllHandle,unsigned _Reason,void *_Reserved);
- extern int (__stdcall *const _pRawDllMain)(void *,unsigned,void *);
+ int __stdcall DllMain(void *_HDllHandle,unsigned long _Reason,void *_Reserved);
+ int __stdcall _CRT_INIT(void *_HDllHandle,unsigned long _Reason,void *_Reserved);
+ int __stdcall _wCRT_INIT(void *_HDllHandle,unsigned long _Reason,void *_Reserved);
+ extern int (__stdcall *const _pRawDllMain)(void *,unsigned long,void *);
#endif
#endif
--
2.37.3.windows.1

16
contrib/src/mingw64/rules.mak

@ -14,7 +14,7 @@ PKGS += winrt_headers alloweduwp
else # !HAVE_WINSTORE
PKGS += d3d9 dcomp
endif # !HAVE_WINSTORE
PKGS += dxva dxvahd
PKGS += dxva dxvahd mingw11-fixes
ifeq ($(call mingw_at_least, 8), true)
PKGS_FOUND += d3d9
@ -33,6 +33,9 @@ endif
ifeq ($(call mingw_at_least, 11), true)
PKGS_FOUND += dxvahd
endif # MINGW 11
ifeq ($(call mingw_at_least, 12), true)
PKGS_FOUND += mingw11-fixes
endif # MINGW 12
endif # !HAVE_VISUALSTUDIO
HAVE_WINPTHREAD := $(shell $(CC) $(CFLAGS) -E -dM -include pthread.h - < /dev/null >/dev/null 2>&1 || echo FAIL)
@ -42,7 +45,7 @@ endif
endif # HAVE_WIN32
PKGS_ALL += winpthreads winrt_headers d3d9 dxva dxvahd dcomp alloweduwp
PKGS_ALL += winpthreads winrt_headers d3d9 dxva dxvahd dcomp mingw11-fixes alloweduwp
$(TARBALLS)/mingw-w64-$(MINGW64_HASH).tar.xz:
$(call download_git,$(MINGW64_GITURL),,$(MINGW64_HASH))
@ -80,6 +83,7 @@ mingw64: mingw-w64-v$(MINGW64_VERSION).tar.bz2 .sum-mingw64
$(APPLY) $(SRC)/mingw64/0003-headers-allow-more-wincrypt-API-s-in-Win10-RS4-UWP-b.patch
$(APPLY) $(SRC)/mingw64/0004-headers-allow-more-wincrypt-API-s-in-Win10-19H1-UWP-.patch
$(APPLY) $(SRC)/mingw64/0005-crt-use-wincrypt-API-from-windowsapp-in-Windows-10.patch
$(APPLY) $(SRC)/mingw64/0001-include-process-fix-bare-DllMain-_CRT_INIT-signature.patch
$(MOVE)
.mingw64: mingw64
@ -121,6 +125,14 @@ MINGW_HEADERS_WINRT := \
install $</mingw-w64-headers/include/dxvahd.h "$(PREFIX)/include"
touch $@
.sum-mingw11-fixes: .sum-mingw64
touch $@
.mingw11-fixes: mingw64
install -d "$(PREFIX)/include"
install $</mingw-w64-headers/crt/process.h "$(PREFIX)/include"
touch $@
.sum-dcomp: .sum-mingw64
touch $@

Loading…
Cancel
Save