From 3a2a13d966d4d392bcb3e9ecdcb24bd317e85e3c Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 1 Mar 2026 11:42:28 -0800
Subject: [PATCH] Loading PNG files are part of the core SDL library
Don't disable this functionality when defining SDL_LEAN_AND_MEAN, but if you need to, you can define SDL_DISABLE_STB if you want to compile this out.
Fixes https://github.com/libsdl-org/SDL/issues/15139
(cherry picked from commit 72d5fe213fcddebaa55774e687d98a6b7d21541c)
---
src/SDL_internal.h | 5 -----
src/video/SDL_stb.c | 5 +++++
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/SDL_internal.h b/src/SDL_internal.h
index 5d1fd3eab2aae..e2debb96bc8cf 100644
--- a/src/SDL_internal.h
+++ b/src/SDL_internal.h
@@ -191,11 +191,6 @@
#define SDL_VIDEO_RENDER_SW 1
#endif
-/* STB image conversion */
-#if !defined(SDL_HAVE_STB) && !defined(SDL_LEAN_AND_MEAN)
-#define SDL_HAVE_STB 1
-#endif
-
/* YUV formats
- handling of YUV surfaces
- blitting and conversion functions */
diff --git a/src/video/SDL_stb.c b/src/video/SDL_stb.c
index a4b0a718ab05b..78e89c7359a48 100644
--- a/src/video/SDL_stb.c
+++ b/src/video/SDL_stb.c
@@ -23,6 +23,11 @@
#include "SDL_stb_c.h"
#include "SDL_surface_c.h"
+/* STB image conversion */
+#ifndef SDL_DISABLE_STB
+#define SDL_HAVE_STB
+#endif
+
#ifdef SDL_HAVE_STB
////////////////////////////////////////////////////////////////////////////
#define malloc SDL_malloc