From 5c2407cdc319f38c9630cec6f0cdc24bc790cfce Mon Sep 17 00:00:00 2001 From: David Given Date: Thu, 29 May 2025 13:40:01 +0200 Subject: [PATCH 1/4] bool is a keyword in C23, so don't try to typedef it. --- mach/proto/top/top.h | 2 -- util/ego/share/types.h | 1 - util/opt/types.h | 1 - 3 files changed, 4 deletions(-) diff --git a/mach/proto/top/top.h b/mach/proto/top/top.h index 0666a710c6..3d1c5cff55 100644 --- a/mach/proto/top/top.h +++ b/mach/proto/top/top.h @@ -82,8 +82,6 @@ struct instr_descr { struct templat templates[MAXOP]; }; -typedef int bool; - #define TRUE 1 #define FALSE 0 diff --git a/util/ego/share/types.h b/util/ego/share/types.h index f86dda6d75..3724625612 100644 --- a/util/ego/share/types.h +++ b/util/ego/share/types.h @@ -18,7 +18,6 @@ typedef struct argbytes argb_t; typedef char byte; -typedef byte bool; typedef long offset; typedef short obj_id; typedef short proc_id; diff --git a/util/opt/types.h b/util/opt/types.h index 4c73c3787c..f323fa7764 100644 --- a/util/opt/types.h +++ b/util/opt/types.h @@ -6,7 +6,6 @@ #define TYPES_H_ typedef unsigned char byte; -typedef char bool; typedef struct line line_t; typedef struct line *line_p; typedef struct sym sym_t; From dbe67493c838898c9dfc8093940ddc2601fdaa1e Mon Sep 17 00:00:00 2001 From: David Given Date: Thu, 29 May 2025 13:48:45 +0200 Subject: [PATCH 2/4] Pre-C23 compilers need stdint.h included here. --- util/ego/share/types.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/ego/share/types.h b/util/ego/share/types.h index 3724625612..39f57837b0 100644 --- a/util/ego/share/types.h +++ b/util/ego/share/types.h @@ -8,6 +8,8 @@ /* This file contains the definitions of the global data types. */ +#include + /* TEMPORARY: */ #define LONGOFF From 3b083928193e874db1a5112abcc166942d4b049e Mon Sep 17 00:00:00 2001 From: David Given Date: Thu, 29 May 2025 13:54:28 +0200 Subject: [PATCH 3/4] Ugh, need stdbool, not stdint. --- util/ego/share/types.h | 1 + 1 file changed, 1 insertion(+) diff --git a/util/ego/share/types.h b/util/ego/share/types.h index 39f57837b0..ba415b19de 100644 --- a/util/ego/share/types.h +++ b/util/ego/share/types.h @@ -9,6 +9,7 @@ */ #include +#include /* TEMPORARY: */ #define LONGOFF From 3ea1f6a236c4a0bdb13cedc5899bbb2b2361796a Mon Sep 17 00:00:00 2001 From: David Given Date: Thu, 29 May 2025 14:02:42 +0200 Subject: [PATCH 4/4] More places which need stdbool.h. --- mach/proto/top/top.h | 2 ++ util/opt/types.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/mach/proto/top/top.h b/mach/proto/top/top.h index 3d1c5cff55..5474f9cd7f 100644 --- a/mach/proto/top/top.h +++ b/mach/proto/top/top.h @@ -5,6 +5,8 @@ */ /* Tunable constants; may be overruled by machine descriptor table */ +#include + #ifndef OP_SEPARATOR #define OP_SEPARATOR ',' #endif diff --git a/util/opt/types.h b/util/opt/types.h index f323fa7764..91b404a398 100644 --- a/util/opt/types.h +++ b/util/opt/types.h @@ -5,6 +5,8 @@ #ifndef TYPES_H_ #define TYPES_H_ +#include + typedef unsigned char byte; typedef struct line line_t; typedef struct line *line_p;