File c23-keywords.patch of Package sane-backends
gitlab.com/sane-project/backends/-/merge_requests/862
gitlab.com/sane-project/backends/-/commit/f5736eb
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.
---
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