From 26f2df80c3f9ac54fc488ed26f6320904881c0d4 Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Tue, 31 Dec 2024 14:47:02 +0100 Subject: [PATCH] helper: list: rename macro clashing with sys/queue.h The macro named LIST_HEAD() clashed with a macro of same name in the GNU libc file sys/queue.h. This causes a warning in MacOS build due to some other system file including sys/queue.h. Rename LIST_HEAD() as OOCD_LIST_HEAD(). Checkpatch-ignore: MACRO_ARG_REUSE Change-Id: Ic653edec77425a58251d64f56c9f5f6c645ba0cd Signed-off-by: Antonio Borneo Reported-by: Andrew Shelley Reviewed-on: https://review.openocd.org/c/openocd/+/8683 Tested-by: jenkins Reviewed-by: Tomas Vanek Reviewed-by: Andy --- contrib/list_example.c | 2 +- src/helper/list.h | 2 +- src/server/telnet_server.c | 2 +- src/target/adi_v5_jtag.c | 2 +- src/target/arm_cti.c | 2 +- src/target/arm_dap.c | 2 +- src/target/arm_tpiu_swo.c | 2 +- src/target/openrisc/or1k.c | 4 ++-- src/target/riscv/riscv-013.c | 2 +- src/target/target.c | 6 +++--- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/contrib/list_example.c b/contrib/list_example.c index 4fcfcdf348..1f28dc2dbd 100644 --- a/contrib/list_example.c +++ b/contrib/list_example.c @@ -12,7 +12,7 @@ #include #include -static LIST_HEAD(threads); +static OOCD_LIST_HEAD(threads); struct thread { int id; diff --git a/src/helper/list.h b/src/helper/list.h index 47290c2602..ba07f15568 100644 --- a/src/helper/list.h +++ b/src/helper/list.h @@ -46,7 +46,7 @@ struct list_head { #define LIST_HEAD_INIT(name) { &(name), &(name) } -#define LIST_HEAD(name) \ +#define OOCD_LIST_HEAD(name) \ struct list_head name = LIST_HEAD_INIT(name) static inline void diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c index 7818af2dbb..2c3f769801 100644 --- a/src/server/telnet_server.c +++ b/src/server/telnet_server.c @@ -570,7 +570,7 @@ static void telnet_auto_complete(struct connection *connection) struct list_head lh; }; - LIST_HEAD(matches); + OOCD_LIST_HEAD(matches); /* - user command sequence, either at line beginning * or we start over after these characters ';', '[', '{' diff --git a/src/target/adi_v5_jtag.c b/src/target/adi_v5_jtag.c index fee1a24858..c9ed5b948b 100644 --- a/src/target/adi_v5_jtag.c +++ b/src/target/adi_v5_jtag.c @@ -431,7 +431,7 @@ static int jtagdp_overrun_check(struct adiv5_dap *dap) struct dap_cmd *el, *tmp, *prev = NULL; int found_wait = 0; int64_t time_now; - LIST_HEAD(replay_list); + OOCD_LIST_HEAD(replay_list); /* make sure all queued transactions are complete */ retval = jtag_execute_queue(); diff --git a/src/target/arm_cti.c b/src/target/arm_cti.c index 88eec832ef..b2f78eef78 100644 --- a/src/target/arm_cti.c +++ b/src/target/arm_cti.c @@ -25,7 +25,7 @@ struct arm_cti { struct adiv5_ap *ap; }; -static LIST_HEAD(all_cti); +static OOCD_LIST_HEAD(all_cti); const char *arm_cti_name(struct arm_cti *self) { diff --git a/src/target/arm_dap.c b/src/target/arm_dap.c index 9f4afae743..c5bd6ccd4d 100644 --- a/src/target/arm_dap.c +++ b/src/target/arm_dap.c @@ -18,7 +18,7 @@ #include "transport/transport.h" #include "jtag/interface.h" -static LIST_HEAD(all_dap); +static OOCD_LIST_HEAD(all_dap); extern struct adapter_driver *adapter_driver; diff --git a/src/target/arm_tpiu_swo.c b/src/target/arm_tpiu_swo.c index c14fd5fc84..e20cd59272 100644 --- a/src/target/arm_tpiu_swo.c +++ b/src/target/arm_tpiu_swo.c @@ -126,7 +126,7 @@ struct arm_tpiu_swo_priv_connection { struct arm_tpiu_swo_object *obj; }; -static LIST_HEAD(all_tpiu_swo); +static OOCD_LIST_HEAD(all_tpiu_swo); #define ARM_TPIU_SWO_TRACE_BUF_SIZE 4096 diff --git a/src/target/openrisc/or1k.c b/src/target/openrisc/or1k.c index 8c38610805..efc076c999 100644 --- a/src/target/openrisc/or1k.c +++ b/src/target/openrisc/or1k.c @@ -27,8 +27,8 @@ #include "or1k.h" #include "or1k_du.h" -LIST_HEAD(tap_list); -LIST_HEAD(du_list); +OOCD_LIST_HEAD(tap_list); +OOCD_LIST_HEAD(du_list); static int or1k_remove_breakpoint(struct target *target, struct breakpoint *breakpoint); diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 658c1fd9db..bb450ce623 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -214,7 +214,7 @@ typedef struct { dm013_info_t *dm; } riscv013_info_t; -static LIST_HEAD(dm_list); +static OOCD_LIST_HEAD(dm_list); static riscv013_info_t *get_info(const struct target *target) { diff --git a/src/target/target.c b/src/target/target.c index 1fc8baf2c0..8deab8f34d 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -108,10 +108,10 @@ struct target *all_targets; static struct target_event_callback *target_event_callbacks; static struct target_timer_callback *target_timer_callbacks; static int64_t target_timer_next_event_value; -static LIST_HEAD(target_reset_callback_list); -static LIST_HEAD(target_trace_callback_list); +static OOCD_LIST_HEAD(target_reset_callback_list); +static OOCD_LIST_HEAD(target_trace_callback_list); static const int polling_interval = TARGET_DEFAULT_POLLING_INTERVAL; -static LIST_HEAD(empty_smp_targets); +static OOCD_LIST_HEAD(empty_smp_targets); enum nvp_assert { NVP_DEASSERT,