From c73a4f099f3fc7fa65b9b7aed735371a19a87b65 Mon Sep 17 00:00:00 2001
From: LIU Hao <[email protected]>
Date: Thu, 22 Jan 2026 10:32:37 +0800
Subject: [PATCH 1/5] headers: Move `MINGW_HAS_DDK_H` from sdks/_mingw_ddk.h to
 _mingw.h

This eliminates the need for sdks/_mingw_ddk.h, so all build rules about it
can be removed.

Signed-off-by: LIU Hao <[email protected]>
---
 mingw-w64-headers/.gitignore               | 1 -
 mingw-w64-headers/Makefile.am              | 8 --------
 mingw-w64-headers/crt/_mingw.h.in          | 4 ++--
 mingw-w64-headers/crt/sdks/_mingw_ddk.h.in | 6 ------
 4 files changed, 2 insertions(+), 17 deletions(-)
 delete mode 100644 mingw-w64-headers/crt/sdks/_mingw_ddk.h.in

diff --git a/mingw-w64-headers/.gitignore b/mingw-w64-headers/.gitignore
index 17ad3be81..73551dbb6 100644
--- a/mingw-w64-headers/.gitignore
+++ b/mingw-w64-headers/.gitignore
@@ -1,2 +1 @@
-_mingw_ddk.h
 crt/_mingw.h
diff --git a/mingw-w64-headers/Makefile.am b/mingw-w64-headers/Makefile.am
index 6ebeda477..dc6d92050 100644
--- a/mingw-w64-headers/Makefile.am
+++ b/mingw-w64-headers/Makefile.am
@@ -9,7 +9,6 @@ gdiplusheaddir = $(baseheaddir)/gdiplus
 wrlheaddir = $(baseheaddir)/wrl
 wrlwrappersheaddir = $(baseheaddir)/wrl/wrappers
 mingwhelperheaddir = $(baseheaddir)/psdk_inc
-sdksheaddir = $(baseheaddir)/sdks

 basehead_HEADERS = @BASEHEAD_LIST@
 syshead_HEADERS = @SYSHEAD_LIST@
@@ -21,8 +20,6 @@ gdiplushead_HEADERS = @GDIPLUSHEAD_LIST@
 wrlhead_HEADERS = @WRLHEAD_LIST@
 wrlwrappershead_HEADERS = @WRLWRAPPERSHEAD_LIST@
 mingwhelperhead_HEADERS = @MINGWHELPERHEAD_LIST@
-nodist_sdkshead_HEADERS = _mingw_ddk.h
-noinst_HEADERS = crt/sdks/_mingw_ddk.h.in

 ddkheaddir = $(baseheaddir)/ddk
 idlheaddir = $(baseheaddir)
@@ -30,8 +27,6 @@ idlheaddir = $(baseheaddir)
 ddkhead_HEADERS = @DDKHEAD_LIST@
 idlhead_HEADERS = @IDLHEAD_LIST@

-CLEANFILES = $(nodist_sdkshead_HEADERS)
-
 DISTCHECK_CONFIGURE_FLAGS = --enable-crt --enable-sdk=all --enable-idl

 EXTRA_DIST = $(srcdir)/ChangeLog.* include crt ddk tlb
@@ -413,6 +408,3 @@ include/prsht.h: ;
 include/wincrypt.h: ;

 endif
-
-_mingw_ddk.h: $(srcdir)/crt/sdks/_mingw_ddk.h.in
-       $(SED) s/MINGW_HAS_DDK$$/@MINGW_HAS_DDK@/ $< > $@
diff --git a/mingw-w64-headers/crt/_mingw.h.in 
b/mingw-w64-headers/crt/_mingw.h.in
index c113c29c6..5d759e2b5 100644
--- a/mingw-w64-headers/crt/_mingw.h.in
+++ b/mingw-w64-headers/crt/_mingw.h.in
@@ -681,8 +681,8 @@ const char *__mingw_get_crt_info (void);
 #define __STDC_SECURE_LIB__ 200411L
 #define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__

-#ifndef __WIDL__
-#include "sdks/_mingw_ddk.h"
+#if @MINGW_HAS_DDK@
+#define MINGW_HAS_DDK_H 1
 #endif

 #endif /* MINGW_SDK_INIT */
diff --git a/mingw-w64-headers/crt/sdks/_mingw_ddk.h.in 
b/mingw-w64-headers/crt/sdks/_mingw_ddk.h.in
deleted file mode 100644
index 0978eddeb..000000000
--- a/mingw-w64-headers/crt/sdks/_mingw_ddk.h.in
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MINGW_DDK_H
-#define MINGW_DDK_H
-#if MINGW_HAS_DDK
-#define MINGW_HAS_DDK_H 1
-#endif
-#endif
--
2.52.0


From 2597f36659a3e8059d82543807eff32a8c300555 Mon Sep 17 00:00:00 2001
From: LIU Hao <[email protected]>
Date: Tue, 20 Jan 2026 15:58:08 +0800
Subject: [PATCH 2/5] headers: Remove unused `AC_PROG_SED`

Signed-off-by: LIU Hao <[email protected]>
---
 mingw-w64-headers/configure.ac | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/mingw-w64-headers/configure.ac b/mingw-w64-headers/configure.ac
index 3211fbd18..186e98992 100644
--- a/mingw-w64-headers/configure.ac
+++ b/mingw-w64-headers/configure.ac
@@ -12,9 +12,6 @@ AM_MAINTAINER_MODE

 AC_CANONICAL_HOST

-# Checks for programs.
-AC_PROG_SED
-
 # Search for a usable widl.  If PATH is given, search there.  Otherwise, search
 # in $PATH.  In all cases, search for a canonicalized name first ($host-widl),
 # followed by a non-canonicalized name (widl).  If these fail, error out.
--
2.52.0


From 47544dbc555a0344068fe30149db763443b46eb9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <[email protected]>
Date: Mon, 19 Jan 2026 15:08:29 +0100
Subject: [PATCH 3/5] Prefer headers in the source tree and generated headers
 over installed ones
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Add `-isystem` to the preprocessor flags that prefer headers in the source
tree or headers the have been generated over ones that have been installed.

Signed-off-by: Markus Mützel <[email protected]>
Signed-off-by: LIU Hao <[email protected]>
---
 mingw-w64-crt/Makefile.am | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 74f35ea12..f3d45d05b 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -11,11 +11,13 @@

 #AUTOMAKE_OPTIONS = color-tests

+sysincludes = -isystem $(top_srcdir)/../mingw-w64-headers/include \
+              -isystem $(top_srcdir)/../mingw-w64-headers/crt \
+              -isystem $(top_builddir)/../mingw-w64-headers/crt
 if WITHSYSROOT
-  sysincludes="-I@TARGET_SYSTEM_ROOT@/include"
+  sysincludes+="-isystem @TARGET_SYSTEM_ROOT@/include"
   withsys="--with-sysroot=@TARGET_SYSTEM_ROOT@"
 else
-  sysincludes=
   withsys=
 endif

--
2.52.0


From 556a15a7510536bf5926c0190d2ce517965d8ef5 Mon Sep 17 00:00:00 2001
From: LIU Hao <[email protected]>
Date: Tue, 20 Jan 2026 13:38:55 +0800
Subject: [PATCH 4/5] headers: Remove obsolete 'defaults' directory

Signed-off-by: LIU Hao <[email protected]>
---
 mingw-w64-headers/defaults/generate.sh               | 3 ---
 mingw-w64-headers/defaults/include/sdks/_mingw_ddk.h | 6 ------
 2 files changed, 9 deletions(-)
 delete mode 100755 mingw-w64-headers/defaults/generate.sh
 delete mode 100644 mingw-w64-headers/defaults/include/sdks/_mingw_ddk.h

diff --git a/mingw-w64-headers/defaults/generate.sh 
b/mingw-w64-headers/defaults/generate.sh
deleted file mode 100755
index b5bd08172..000000000
--- a/mingw-w64-headers/defaults/generate.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-sed s/@MINGW_HAS_DDK@/0/ crt/sdks/_mingw_ddk.h.in > 
defaults/include/sdks/_mingw_ddk.h
diff --git a/mingw-w64-headers/defaults/include/sdks/_mingw_ddk.h b/mingw-w64-headers/defaults/include/sdks/_mingw_ddk.h
deleted file mode 100644
index 93b2742b2..000000000
--- a/mingw-w64-headers/defaults/include/sdks/_mingw_ddk.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MINGW_DDK_H
-#define MINGW_DDK_H
-#if 0
-#define MINGW_HAS_DDK_H 1
-#endif
-#endif
--
2.52.0


From c73a4f099f3fc7fa65b9b7aed735371a19a87b65 Mon Sep 17 00:00:00 2001
From: LIU Hao <[email protected]>
Date: Thu, 22 Jan 2026 10:32:37 +0800
Subject: [PATCH 1/5] headers: Move `MINGW_HAS_DDK_H` from sdks/_mingw_ddk.h to
 _mingw.h

This eliminates the need for sdks/_mingw_ddk.h, so all build rules about it
can be removed.

Signed-off-by: LIU Hao <[email protected]>
---
 mingw-w64-headers/.gitignore               | 1 -
 mingw-w64-headers/Makefile.am              | 8 --------
 mingw-w64-headers/crt/_mingw.h.in          | 4 ++--
 mingw-w64-headers/crt/sdks/_mingw_ddk.h.in | 6 ------
 4 files changed, 2 insertions(+), 17 deletions(-)
 delete mode 100644 mingw-w64-headers/crt/sdks/_mingw_ddk.h.in

diff --git a/mingw-w64-headers/.gitignore b/mingw-w64-headers/.gitignore
index 17ad3be81..73551dbb6 100644
--- a/mingw-w64-headers/.gitignore
+++ b/mingw-w64-headers/.gitignore
@@ -1,2 +1 @@
-_mingw_ddk.h
 crt/_mingw.h
diff --git a/mingw-w64-headers/Makefile.am b/mingw-w64-headers/Makefile.am
index 6ebeda477..dc6d92050 100644
--- a/mingw-w64-headers/Makefile.am
+++ b/mingw-w64-headers/Makefile.am
@@ -9,7 +9,6 @@ gdiplusheaddir = $(baseheaddir)/gdiplus
 wrlheaddir = $(baseheaddir)/wrl
 wrlwrappersheaddir = $(baseheaddir)/wrl/wrappers
 mingwhelperheaddir = $(baseheaddir)/psdk_inc
-sdksheaddir = $(baseheaddir)/sdks
 
 basehead_HEADERS = @BASEHEAD_LIST@
 syshead_HEADERS = @SYSHEAD_LIST@
@@ -21,8 +20,6 @@ gdiplushead_HEADERS = @GDIPLUSHEAD_LIST@
 wrlhead_HEADERS = @WRLHEAD_LIST@
 wrlwrappershead_HEADERS = @WRLWRAPPERSHEAD_LIST@
 mingwhelperhead_HEADERS = @MINGWHELPERHEAD_LIST@
-nodist_sdkshead_HEADERS = _mingw_ddk.h
-noinst_HEADERS = crt/sdks/_mingw_ddk.h.in
 
 ddkheaddir = $(baseheaddir)/ddk
 idlheaddir = $(baseheaddir)
@@ -30,8 +27,6 @@ idlheaddir = $(baseheaddir)
 ddkhead_HEADERS = @DDKHEAD_LIST@
 idlhead_HEADERS = @IDLHEAD_LIST@
 
-CLEANFILES = $(nodist_sdkshead_HEADERS)
-
 DISTCHECK_CONFIGURE_FLAGS = --enable-crt --enable-sdk=all --enable-idl
 
 EXTRA_DIST = $(srcdir)/ChangeLog.* include crt ddk tlb
@@ -413,6 +408,3 @@ include/prsht.h: ;
 include/wincrypt.h: ;
 
 endif
-
-_mingw_ddk.h: $(srcdir)/crt/sdks/_mingw_ddk.h.in
-       $(SED) s/MINGW_HAS_DDK$$/@MINGW_HAS_DDK@/ $< > $@
diff --git a/mingw-w64-headers/crt/_mingw.h.in 
b/mingw-w64-headers/crt/_mingw.h.in
index c113c29c6..5d759e2b5 100644
--- a/mingw-w64-headers/crt/_mingw.h.in
+++ b/mingw-w64-headers/crt/_mingw.h.in
@@ -681,8 +681,8 @@ const char *__mingw_get_crt_info (void);
 #define __STDC_SECURE_LIB__ 200411L
 #define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__
 
-#ifndef __WIDL__
-#include "sdks/_mingw_ddk.h"
+#if @MINGW_HAS_DDK@
+#define MINGW_HAS_DDK_H 1
 #endif
 
 #endif /* MINGW_SDK_INIT */
diff --git a/mingw-w64-headers/crt/sdks/_mingw_ddk.h.in 
b/mingw-w64-headers/crt/sdks/_mingw_ddk.h.in
deleted file mode 100644
index 0978eddeb..000000000
--- a/mingw-w64-headers/crt/sdks/_mingw_ddk.h.in
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MINGW_DDK_H
-#define MINGW_DDK_H
-#if MINGW_HAS_DDK
-#define MINGW_HAS_DDK_H 1
-#endif
-#endif
-- 
2.52.0

From 2597f36659a3e8059d82543807eff32a8c300555 Mon Sep 17 00:00:00 2001
From: LIU Hao <[email protected]>
Date: Tue, 20 Jan 2026 15:58:08 +0800
Subject: [PATCH 2/5] headers: Remove unused `AC_PROG_SED`

Signed-off-by: LIU Hao <[email protected]>
---
 mingw-w64-headers/configure.ac | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/mingw-w64-headers/configure.ac b/mingw-w64-headers/configure.ac
index 3211fbd18..186e98992 100644
--- a/mingw-w64-headers/configure.ac
+++ b/mingw-w64-headers/configure.ac
@@ -12,9 +12,6 @@ AM_MAINTAINER_MODE
 
 AC_CANONICAL_HOST
 
-# Checks for programs.
-AC_PROG_SED
-
 # Search for a usable widl.  If PATH is given, search there.  Otherwise, search
 # in $PATH.  In all cases, search for a canonicalized name first ($host-widl),
 # followed by a non-canonicalized name (widl).  If these fail, error out.
-- 
2.52.0

From 47544dbc555a0344068fe30149db763443b46eb9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <[email protected]>
Date: Mon, 19 Jan 2026 15:08:29 +0100
Subject: [PATCH 3/5] Prefer headers in the source tree and generated headers
 over installed ones
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Add `-isystem` to the preprocessor flags that prefer headers in the source
tree or headers the have been generated over ones that have been installed.

Signed-off-by: Markus Mützel <[email protected]>
Signed-off-by: LIU Hao <[email protected]>
---
 mingw-w64-crt/Makefile.am | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 74f35ea12..f3d45d05b 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -11,11 +11,13 @@
 
 #AUTOMAKE_OPTIONS = color-tests
 
+sysincludes = -isystem $(top_srcdir)/../mingw-w64-headers/include \
+              -isystem $(top_srcdir)/../mingw-w64-headers/crt \
+              -isystem $(top_builddir)/../mingw-w64-headers/crt
 if WITHSYSROOT
-  sysincludes="-I@TARGET_SYSTEM_ROOT@/include"
+  sysincludes+="-isystem @TARGET_SYSTEM_ROOT@/include"
   withsys="--with-sysroot=@TARGET_SYSTEM_ROOT@"
 else
-  sysincludes=
   withsys=
 endif
 
-- 
2.52.0

From 556a15a7510536bf5926c0190d2ce517965d8ef5 Mon Sep 17 00:00:00 2001
From: LIU Hao <[email protected]>
Date: Tue, 20 Jan 2026 13:38:55 +0800
Subject: [PATCH 4/5] headers: Remove obsolete 'defaults' directory

Signed-off-by: LIU Hao <[email protected]>
---
 mingw-w64-headers/defaults/generate.sh               | 3 ---
 mingw-w64-headers/defaults/include/sdks/_mingw_ddk.h | 6 ------
 2 files changed, 9 deletions(-)
 delete mode 100755 mingw-w64-headers/defaults/generate.sh
 delete mode 100644 mingw-w64-headers/defaults/include/sdks/_mingw_ddk.h

diff --git a/mingw-w64-headers/defaults/generate.sh 
b/mingw-w64-headers/defaults/generate.sh
deleted file mode 100755
index b5bd08172..000000000
--- a/mingw-w64-headers/defaults/generate.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-sed s/@MINGW_HAS_DDK@/0/ crt/sdks/_mingw_ddk.h.in > 
defaults/include/sdks/_mingw_ddk.h
diff --git a/mingw-w64-headers/defaults/include/sdks/_mingw_ddk.h 
b/mingw-w64-headers/defaults/include/sdks/_mingw_ddk.h
deleted file mode 100644
index 93b2742b2..000000000
--- a/mingw-w64-headers/defaults/include/sdks/_mingw_ddk.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MINGW_DDK_H
-#define MINGW_DDK_H
-#if 0
-#define MINGW_HAS_DDK_H 1
-#endif
-#endif
-- 
2.52.0

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to