Description: Fix FTBFS with GCC 15 defaulting to C23
 config.h's old-style `typedef enum { FALSE, TRUE } bool;` conflicts with the C23
 keyword bool; guard the typedef with a __STDC_VERSION__ check.  lib/cmdopen.c
 and lib/readln.c miss <stdlib.h>/<string.h> for exit()/memcpy() declarations.
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Origin: other
Forwarded: not-needed
Last-Update: 2026-09-05

--- sn-0.3.8.orig/config.h
+++ sn-0.3.8/config.h
@@ -96,6 +96,12 @@ extern int debug;
 
 #undef FALSE   /* Mac OS X apparently defines these */
 #undef TRUE
+#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L)
+/* C23 makes bool a built-in keyword; provide FALSE/TRUE as macros. */
+#define FALSE 0
+#define TRUE 1
+#else
 typedef enum { FALSE, TRUE } bool;
+#endif
 
 #endif /* CONFIG_H */
--- sn-0.3.8.orig/lib/cmdopen.c
+++ sn-0.3.8/lib/cmdopen.c
@@ -6,6 +6,7 @@
  */
 
 #include <unistd.h>
+#include <stdlib.h>
 #include <fcntl.h>
 #include <sys/wait.h>
 
--- sn-0.3.8.orig/lib/readln.c
+++ sn-0.3.8/lib/readln.c
@@ -10,6 +10,7 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/time.h>
