From: Victor Seva <vseva@debian.org>
Date: Wed, 17 Sep 2025 08:37:30 +0200
Subject: fix gcc15 build

---
 conv.c        | 4 ++++
 getcode.c     | 4 ++++
 sjis_doti.c   | 4 ++++
 sjis_imode1.c | 4 ++++
 sjis_imode2.c | 4 ++++
 sjis_jsky1.c  | 4 ++++
 sjis_jsky2.c  | 4 ++++
 7 files changed, 28 insertions(+)

diff --git a/conv.c b/conv.c
index 7e61d4e..f1927b4 100644
--- a/conv.c
+++ b/conv.c
@@ -31,11 +31,15 @@
 #endif
 
 #ifndef __cplusplus
+#if __STDC_VERSION__ >= 202311L
+	/* bool is part of the C23 standard */
+#else
 #undef bool
 #undef true
 #undef false
 typedef enum bool { false, true, } bool;
 #endif
+#endif
 
 /* ----------------------------------------------------------------------------
  * SV* sv_utf8 = xs_sjis_utf8(SV* sv_sjis)
diff --git a/getcode.c b/getcode.c
index 2b9f77f..b8b54f6 100644
--- a/getcode.c
+++ b/getcode.c
@@ -30,11 +30,15 @@ extern SV ** Perl_stack_base;
 #define GC_DISP 0
 
 #ifndef __cplusplus
+#if __STDC_VERSION__ >= 202311L
+	/* bool is part of the C23 standard */
+#else
 #undef bool
 #undef true
 #undef false
 typedef enum bool { false, true, } bool;
 #endif
+#endif
 
 /* 文字コード定数 */
 enum charcode_t
diff --git a/sjis_doti.c b/sjis_doti.c
index 982041e..5aa233e 100644
--- a/sjis_doti.c
+++ b/sjis_doti.c
@@ -5,11 +5,15 @@
 #include <stdio.h>
 
 #ifndef __cplusplus
+#if __STDC_VERSION__ >= 202311L
+	/* bool is part of the C23 standard */
+#else
 #undef bool
 #undef true
 #undef false
 typedef enum bool { false, true, } bool;
 #endif
+#endif
 
 #define DISP_U2S 0
 #define DISP_S2U 0
diff --git a/sjis_imode1.c b/sjis_imode1.c
index 83c36c2..201b2da 100644
--- a/sjis_imode1.c
+++ b/sjis_imode1.c
@@ -5,11 +5,15 @@
 #include <stdio.h>
 
 #ifndef __cplusplus
+#if __STDC_VERSION__ >= 202311L
+	/* bool is part of the C23 standard */
+#else
 #undef bool
 #undef true
 #undef false
 typedef enum bool { false, true, } bool;
 #endif
+#endif
 
 #define DISP_U2S 0
 #define DISP_S2U 0
diff --git a/sjis_imode2.c b/sjis_imode2.c
index 3682259..d45d9d0 100644
--- a/sjis_imode2.c
+++ b/sjis_imode2.c
@@ -5,11 +5,15 @@
 #include <stdio.h>
 
 #ifndef __cplusplus
+#if __STDC_VERSION__ >= 202311L
+	/* bool is part of the C23 standard */
+#else
 #undef bool
 #undef true
 #undef false
 typedef enum bool { false, true, } bool;
 #endif
+#endif
 
 #define DISP_U2S 0
 #define DISP_S2U 0
diff --git a/sjis_jsky1.c b/sjis_jsky1.c
index 46048b3..d962cfa 100644
--- a/sjis_jsky1.c
+++ b/sjis_jsky1.c
@@ -5,11 +5,15 @@
 #include <stdio.h>
 
 #ifndef __cplusplus
+#if __STDC_VERSION__ >= 202311L
+	/* bool is part of the C23 standard */
+#else
 #undef bool
 #undef true
 #undef false
 typedef enum bool { false, true, } bool;
 #endif
+#endif
 
 #define DISP_U2S 0
 #define DISP_S2U 0
diff --git a/sjis_jsky2.c b/sjis_jsky2.c
index 8bb879c..1779bbb 100644
--- a/sjis_jsky2.c
+++ b/sjis_jsky2.c
@@ -5,11 +5,15 @@
 #include <stdio.h>
 
 #ifndef __cplusplus
+#if __STDC_VERSION__ >= 202311L
+	/* bool is part of the C23 standard */
+#else
 #undef bool
 #undef true
 #undef false
 typedef enum bool { false, true, } bool;
 #endif
+#endif
 
 #define DISP_U2S 0
 #define DISP_S2U 0
