Forráskód Böngészése

package/libxmlrpc: fix boolean definitions

Don't define boolean macros for C23 standard as they are implemented
as keywords.

Fixes the following error:

make[2]: Entering directory
'/home/user/Documents/versioned/oss/xmlrpc-c/lib/util'
gcc -c -DNDEBUG -pthread -Wall -W -Wno-uninitialized -Wundef
-Wno-unknown-pragmas -Wmissing-declarations -Wstrict-prototypes
-Wmissing-prototypes -Wimplicit -fno-common -g -O3
-Isrcdir/lib/util/include
-I/home/user/Documents/versioned/oss/xmlrpc-c   casprintf.c
In file included from casprintf.c:9:
srcdir/lib/util/include/bool.h:13:5: error: cannot use keyword ‘false’
as enumeration constant
   13 |     false = 0,
      |     ^~~~~
srcdir/lib/util/include/bool.h:13:5: note: ‘false’ is a keyword with
‘-std=c23’ onwards
srcdir/lib/util/include/bool.h:15:3: error: expected ‘;’, identifier
or ‘(’ before ‘bool’
   15 | } bool;
      |   ^~~~
srcdir/lib/util/include/bool.h:15:3: warning: useless type name in
empty declaration

Upstream: https://sourceforge.net/p/xmlrpc-c/code/3318/

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
Yegor Yefremov 1 hete
szülő
commit
5b5889ee5f
1 módosított fájl, 25 hozzáadás és 0 törlés
  1. 25 0
      package/libxmlrpc/0001-Fix-boolean-definitions.patch

+ 25 - 0
package/libxmlrpc/0001-Fix-boolean-definitions.patch

@@ -0,0 +1,25 @@
+Index: lib/util/include/bool.h
+===================================================================
+Don't define boolean macros for C23 standard as they are implemented
+as keywords.
+
+Upstream: https://sourceforge.net/p/xmlrpc-c/code/3318/
+
+Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
+
+diff --git a/lib/util/include/bool.h b/lib/util/include/bool.h
+--- a/lib/util/include/bool.h	(revision 3316)
++++ b/lib/util/include/bool.h	(working copy)
+@@ -5,7 +5,11 @@
+    collision.
+ */
+ 
+-#ifndef __cplusplus
++#ifdef __cplusplus
++/* bool has always been part of the C++ language */
++#elif __STDC_VERSION__ >= 202311L
++/* bool is part of the C23 standard */
++#else
+ /* At least the GNU compiler defines __bool_true_false_are_defined */
+ #ifndef __bool_true_false_are_defined
+ #define __bool_true_false_are_defined