From 8a10475c4698af44fe4e50d397012ef8e7f0decf Mon Sep 17 00:00:00 2001
From: Simon McVittie <[EMAIL REDACTED]>
Date: Fri, 16 Jan 2026 20:02:16 +0000
Subject: [PATCH] png: Only include IMG_ImageIO.h conditionally
IMG_ImageIO.{h,m} contain a copyright notice that is unlikely to be
accurate (claiming that the copyright holder is named
`__MyCompanyName__`), an "all rights reserved" statement and no license
grant.
As a result, software distributions that are cautious about copyright
(such as Debian) tend to treat it as non-open-source and potentially
copyright-infringing to include in their packages, and therefore
strip it out from the upstream source releases during packaging.
It's only used on the macOS family, so no functionality is lost by
doing this on other OSs. However, we do need to avoid including its
headers if they might not even be present.
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
src/IMG_png.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/IMG_png.c b/src/IMG_png.c
index 0580bbe5..f6fccd17 100644
--- a/src/IMG_png.c
+++ b/src/IMG_png.c
@@ -23,7 +23,10 @@
#include <SDL3_image/SDL_image.h>
+#ifdef PNG_USES_IMAGEIO
#include "IMG_ImageIO.h"
+#endif
+
#include "IMG_libpng.h"
#include "IMG_WIC.h"