rdobuilder a4355a
diff -rupN --no-dereference Pillow-11.0.0/setup.py Pillow-11.0.0-new/setup.py
rdobuilder a4355a
--- Pillow-11.0.0/setup.py	2024-10-15 07:55:00.000000000 +0200
rdobuilder a4355a
+++ Pillow-11.0.0-new/setup.py	2024-10-15 08:59:42.716831470 +0200
rdobuilder a4355a
@@ -142,7 +142,7 @@ class RequiredDependencyException(Except
rdobuilder a4355a
     pass
rdobuilder a4355a
 
rdobuilder a4355a
 
rdobuilder a4355a
-PLATFORM_MINGW = os.name == "nt" and "GCC" in sys.version
rdobuilder a4355a
+PLATFORM_MINGW = "mingw32" in os.getenv("CC", "")
rdobuilder a4355a
 
rdobuilder a4355a
 
rdobuilder a4355a
 def _dbg(s: str, tp: Any = None) -> None:
rdobuilder a4355a
@@ -550,7 +550,7 @@ class pil_build_ext(build_ext):
rdobuilder a4355a
         #
rdobuilder a4355a
         # add platform directories
rdobuilder a4355a
 
rdobuilder a4355a
-        if self.disable_platform_guessing:
rdobuilder a4355a
+        if self.disable_platform_guessing or PLATFORM_MINGW:
rdobuilder a4355a
             pass
rdobuilder a4355a
 
rdobuilder a4355a
         elif sys.platform == "cygwin":
rdobuilder a4355a
@@ -644,7 +644,7 @@ class pil_build_ext(build_ext):
rdobuilder a4355a
         # FIXME: check /opt/stuff directories here?
rdobuilder a4355a
 
rdobuilder a4355a
         # standard locations
rdobuilder a4355a
-        if not self.disable_platform_guessing:
rdobuilder a4355a
+        if not self.disable_platform_guessing and not PLATFORM_MINGW:
rdobuilder a4355a
             _add_directory(library_dirs, "/usr/local/lib")
rdobuilder a4355a
             _add_directory(include_dirs, "/usr/local/include")
rdobuilder a4355a
 
rdobuilder a4355a
@@ -877,7 +877,7 @@ class pil_build_ext(build_ext):
rdobuilder a4355a
         if feature.get("xcb"):
rdobuilder a4355a
             libs.append(feature.get("xcb"))
rdobuilder a4355a
             defs.append(("HAVE_XCB", None))
rdobuilder a4355a
-        if sys.platform == "win32":
rdobuilder a4355a
+        if sys.platform == "win32" or PLATFORM_MINGW:
rdobuilder a4355a
             libs.extend(["kernel32", "user32", "gdi32"])
rdobuilder a4355a
         if struct.unpack("h", b"\0\1")[0] == 1:
rdobuilder a4355a
             defs.append(("WORDS_BIGENDIAN", None))
rdobuilder a4355a
@@ -892,6 +892,8 @@ class pil_build_ext(build_ext):
rdobuilder a4355a
         if feature.get("freetype"):
rdobuilder a4355a
             srcs = []
rdobuilder a4355a
             libs = ["freetype"]
rdobuilder a4355a
+            if sys.platform == "win32" or PLATFORM_MINGW:
rdobuilder a4355a
+                libs.extend(["dl"])
rdobuilder a4355a
             defs = []
rdobuilder a4355a
             if feature.get("raqm"):
rdobuilder a4355a
                 if not feature.want_vendor("raqm"):  # using system Raqm
rdobuilder a4355a
@@ -914,7 +916,7 @@ class pil_build_ext(build_ext):
rdobuilder a4355a
 
rdobuilder a4355a
         if feature.get("lcms"):
rdobuilder a4355a
             libs = [feature.get("lcms")]
rdobuilder a4355a
-            if sys.platform == "win32":
rdobuilder a4355a
+            if sys.platform == "win32" or PLATFORM_MINGW:
rdobuilder a4355a
                 libs.extend(["user32", "gdi32"])
rdobuilder a4355a
             self._update_extension("PIL._imagingcms", libs)
rdobuilder a4355a
         else:
rdobuilder a4355a
@@ -927,7 +929,7 @@ class pil_build_ext(build_ext):
rdobuilder a4355a
         else:
rdobuilder a4355a
             self._remove_extension("PIL._webp")
rdobuilder a4355a
 
rdobuilder a4355a
-        tk_libs = ["psapi"] if sys.platform in ("win32", "cygwin") else []
rdobuilder a4355a
+        tk_libs = ["psapi"] if sys.platform in ("win32", "cygwin") or PLATFORM_MINGW else []
rdobuilder a4355a
         self._update_extension("PIL._imagingtk", tk_libs)
rdobuilder a4355a
 
rdobuilder a4355a
         build_ext.build_extensions(self)
rdobuilder a4355a
diff -rupN --no-dereference Pillow-11.0.0/src/libImaging/ImPlatform.h Pillow-11.0.0-new/src/libImaging/ImPlatform.h
rdobuilder a4355a
--- Pillow-11.0.0/src/libImaging/ImPlatform.h	2024-10-15 07:55:00.000000000 +0200
rdobuilder a4355a
+++ Pillow-11.0.0-new/src/libImaging/ImPlatform.h	2024-10-15 08:59:42.716831470 +0200
rdobuilder a4355a
@@ -29,7 +29,7 @@
rdobuilder a4355a
 #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
rdobuilder a4355a
 
rdobuilder a4355a
 #define WIN32_LEAN_AND_MEAN
rdobuilder a4355a
-#include <Windows.h>
rdobuilder a4355a
+#include <windows.h>
rdobuilder a4355a
 
rdobuilder a4355a
 #ifdef __CYGWIN__
rdobuilder a4355a
 #undef _WIN64