From 016993bd9ab334f4419cbb9b2e9c383e7554d4df Mon Sep 17 00:00:00 2001 From: Bernd Kuhls Date: Tue, 4 Nov 2025 22:42:50 +0100 Subject: [PATCH] package/sane-backends: fix build with gcc >= 15.x Fixes: https://autobuild.buildroot.net/results/296/2961e7aa23d66e7cf364c2caeafc1c226ccd48d9/ Signed-off-by: Bernd Kuhls Signed-off-by: Julien Olivain --- ...sm3600.h-Fix-build-with-standard-C23.patch | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 package/sane-backends/0002-sm3600.h-Fix-build-with-standard-C23.patch diff --git a/package/sane-backends/0002-sm3600.h-Fix-build-with-standard-C23.patch b/package/sane-backends/0002-sm3600.h-Fix-build-with-standard-C23.patch new file mode 100644 index 0000000000..287de48285 --- /dev/null +++ b/package/sane-backends/0002-sm3600.h-Fix-build-with-standard-C23.patch @@ -0,0 +1,38 @@ +From 90815a9f2576c2428287a500cab6caeddb80f9a8 Mon Sep 17 00:00:00 2001 +From: Zdenek Dohnal +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 +--- + 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 +