| 1 |
Description: Use stdbool if available to work around boolean changes. |
| 2 |
Author: Agustin Martin Domingo <[email protected]> |
| 3 |
Forwarded: https://sourceforge.net/p/regina-rexx/bugs/612/ |
| 4 |
Bug-Debian: http://bugs.debian.org/1097785 |
| 5 |
|
| 6 |
Seems that there were some C23 changes with booleans. |
| 7 |
|
| 8 |
x86_64-linux-gnu-gcc ... ./regutil/regfilesys.c |
| 9 |
In file included from ./regutil/regfilesys.c:29: |
| 10 |
./regutil/regutil.h:28:4: error: expected identifier before 'false' |
| 11 |
28 | false, |
| 12 |
| ^~~~~ |
| 13 |
|
| 14 |
This patch uses stdbool.h if available. If so, makes rxbool |
| 15 |
a bool through typedef. Otherwise uses rxbool old definition. |
| 16 |
|
| 17 |
--- a/config.h.in |
| 18 |
+++ b/config.h.in |
| 19 |
@@ -246,6 +246,9 @@ |
| 20 |
/* Define if you have the <stdarg.h> header file. */ |
| 21 |
#undef HAVE_STDARG_H |
| 22 |
|
| 23 |
+/* Define if you have the <stdbool.h> header file. */ |
| 24 |
+#undef HAVE_STDBOOL_H |
| 25 |
+ |
| 26 |
/* Define if you have the <stdio.h> header file. */ |
| 27 |
#undef HAVE_STDIO_H |
| 28 |
|
| 29 |
--- a/configure |
| 30 |
+++ b/configure |
| 31 |
@@ -4725,6 +4725,7 @@ for ac_header in \ |
| 32 |
signal.h \ |
| 33 |
socket.h \ |
| 34 |
stdarg.h \ |
| 35 |
+ stdbool.h \ |
| 36 |
stdio.h \ |
| 37 |
statvfs.h \ |
| 38 |
stdlib.h \ |
| 39 |
--- a/configure.in |
| 40 |
+++ b/configure.in |
| 41 |
@@ -179,6 +179,7 @@ AC_CHECK_HEADERS( \ |
| 42 |
signal.h \ |
| 43 |
socket.h \ |
| 44 |
stdarg.h \ |
| 45 |
+ stdbool.h \ |
| 46 |
stdio.h \ |
| 47 |
statvfs.h \ |
| 48 |
stdlib.h \ |
| 49 |
--- a/regutil/regutil.h |
| 50 |
+++ b/regutil/regutil.h |
| 51 |
@@ -24,10 +24,15 @@ |
| 52 |
|
| 53 |
#include "rxproto.h" |
| 54 |
|
| 55 |
+#ifdef HAVE_STDBOOL_H |
| 56 |
+# include <stdbool.h> |
| 57 |
+typedef bool rxbool; |
| 58 |
+#else |
| 59 |
typedef enum { |
| 60 |
false, |
| 61 |
true |
| 62 |
} rxbool; |
| 63 |
+#endif |
| 64 |
|
| 65 |
void init_random(void); |
| 66 |
|