diff mbox series

[master/scarthgap] switch-config: use proper definition of boolean type

Message ID 20250506233457.436824-1-denis@denix.org
State New
Headers show
Series [master/scarthgap] switch-config: use proper definition of boolean type | expand

Commit Message

Denys Dmytriyenko May 6, 2025, 11:34 p.m. UTC
From: Denys Dmytriyenko <denys@konsulko.com>

Newer versions of GCC and C standard have bool as a built-in
keyword - use a standard stdbool.h header to properly handle it.

Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
---
 ...se-proper-definition-of-boolean-type.patch | 34 +++++++++++++++++++
 .../switch-config/switch-config_git.bb        |  2 ++
 2 files changed, 36 insertions(+)
 create mode 100644 meta-arago-test/recipes-bsp/switch-config/files/0001-Use-proper-definition-of-boolean-type.patch
diff mbox series

Patch

diff --git a/meta-arago-test/recipes-bsp/switch-config/files/0001-Use-proper-definition-of-boolean-type.patch b/meta-arago-test/recipes-bsp/switch-config/files/0001-Use-proper-definition-of-boolean-type.patch
new file mode 100644
index 00000000..23c6d297
--- /dev/null
+++ b/meta-arago-test/recipes-bsp/switch-config/files/0001-Use-proper-definition-of-boolean-type.patch
@@ -0,0 +1,34 @@ 
+From 5190913c7a86cd36b91dc3a6ff4c1eb22ea6375e Mon Sep 17 00:00:00 2001
+From: Denys Dmytriyenko <denys@konsulko.com>
+Date: Tue, 6 May 2025 12:52:14 -0400
+Subject: [PATCH] Use proper definition of boolean type
+
+Newer versions of GCC and C standard have bool as a built-in
+keyword - use a standard stdbool.h header to properly handle it.
+
+Upstream-Status: Inactive-Upstream
+
+Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
+---
+ switch-config.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/switch-config.c b/switch-config.c
+index d31a237..5b5db3a 100644
+--- a/switch-config.c
++++ b/switch-config.c
+@@ -13,10 +13,7 @@
+  * GNU General Public License for more details.
+  */
+ 
+-#define true 1
+-#define false 0
+-typedef int bool;
+-
++#include <stdbool.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+-- 
+2.25.1
+
diff --git a/meta-arago-test/recipes-bsp/switch-config/switch-config_git.bb b/meta-arago-test/recipes-bsp/switch-config/switch-config_git.bb
index 1160b45d..4d4b1f60 100644
--- a/meta-arago-test/recipes-bsp/switch-config/switch-config_git.bb
+++ b/meta-arago-test/recipes-bsp/switch-config/switch-config_git.bb
@@ -13,6 +13,8 @@  SRCREV:aarch64 = "0f52dcb3c4e3678e96427d546d6c2e1fabc2ad91"
 
 SRC_URI = "git://git.ti.com/git/switch-config/switch-config.git;protocol=https;branch=${BRANCH}"
 
+SRC_URI += "file://0001-Use-proper-definition-of-boolean-type.patch"
+
 S = "${WORKDIR}/git"
 
 EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} CC="${CC}""