From 3fac63ac783bdb40f724ab22ceb5cca5d1bb8adb Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Fri, 30 Sep 2022 11:07:55 -0400
Subject: [PATCH] SDL_config.h: Define HAVE_STRLCPY on some platforms.
This makes 1.2 apps compiled with sdl12-compat's headers work with
a real SDL 1.2 library on macOS. Otherwise: missing symbol.
---
include/SDL/SDL_config.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/SDL/SDL_config.h b/include/SDL/SDL_config.h
index 7b832a0e8..d76b2de08 100644
--- a/include/SDL/SDL_config.h
+++ b/include/SDL/SDL_config.h
@@ -133,7 +133,6 @@ stage, though. Send patches if your platform lacks something. */
#define HAVE_BCOPY 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
-#define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1
#define HAVE__STRREV 1
#define HAVE__STRUPR 1
@@ -166,6 +165,10 @@ stage, though. Send patches if your platform lacks something. */
#define HAVE_SETJMP 1
#endif
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) /* macos and BSDs have this. */
+#define HAVE_STRLCPY 1
+#endif
+
/* Don't define most of the SDL backends, under the assumption checking for these against the headers won't work anyhow.
The exception is the X11 backend; you need its define to know if you can use its syswm interface. */