File: 0001-Fix-build-on-C23-compiler-gcc-15.patch

package info (click to toggle)
pdsh 2.35-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,008 kB
  • sloc: ansic: 12,433; sh: 6,838; makefile: 400; perl: 163
file content (36 lines) | stat: -rw-r--r-- 959 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 01b1a2150e5d2c1a065aeb05a504f1f92b2cc147 Mon Sep 17 00:00:00 2001
From: Egbert Eich <eich@suse.com>
Date: Sun, 9 Mar 2025 11:12:22 +0100
Subject: [PATCH] Fix build on C23 compiler (gcc >= 15)

'true' and 'false' are proper keywords in C23.
This fixes issue #165.

Signed-off-by: Egbert Eich <eich@suse.com>
Signed-off-by: Arif Ali <arif-ali@ubuntu.com>

Origin: upstream, https://github.com/chaos/pdsh/commit/01b1a2150e5d2c1a065aeb05a504f1f92b2cc147
Forwarded: not-needed
---
 src/common/macros.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/common/macros.h b/src/common/macros.h
index 3cab336..ea227ab 100644
--- a/src/common/macros.h
+++ b/src/common/macros.h
@@ -58,9 +58,11 @@
 
 #ifndef _BOOL_DEFINED
 #  define _BOOL_DEFINED
+# if __STDC_VERSION__ < 202311L
 #  if !defined (true) && !defined (false)
 typedef enum { false, true } bool;
 #  endif
+# endif
 #endif
 
 #endif                          /* !_MACROS_INCLUDED */
-- 
2.48.1