package/sane-backends: fix build with gcc >= 15.x

Fixes:
https://autobuild.buildroot.net/results/296/2961e7aa23d66e7cf364c2caeafc1c226ccd48d9/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Bernd Kuhls
2025-11-21 22:13:05 +01:00
committed by Julien Olivain
parent 7c8edc1b40
commit 016993bd9a
@@ -0,0 +1,38 @@
From 90815a9f2576c2428287a500cab6caeddb80f9a8 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Wed, 5 Feb 2025 13:19:11 +0100
Subject: [PATCH] sm3600.h: Fix build with standard C23
bool, true and false are keywords in the standard C23 - the sm3600
backend defines them on its own, which is forbidden with the new
standard.
The patch adds ifdef guards for the affected typedef - the old code
will be used for older standards, C23 will define TBool as bool.
Upstream: https://gitlab.com/sane-project/backends/-/commit/90815a9f2576c2428287a500cab6caeddb80f9a8
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
backend/sm3600.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/backend/sm3600.h b/backend/sm3600.h
index 2ecbeb236..5d8a8d809 100644
--- a/backend/sm3600.h
+++ b/backend/sm3600.h
@@ -77,7 +77,11 @@ Start: 2.4.2001
/* ====================================================================== */
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L
typedef enum { false, true } TBool;
+#else
+typedef bool TBool;
+#endif /* GCC < 15 */
typedef SANE_Status TState;
--
GitLab