Skip to content

Commit

Permalink
helper: list: rename macro clashing with sys/queue.h
Browse files Browse the repository at this point in the history
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 <borneo.antonio@gmail.com>
Reported-by: Andrew Shelley <ashelley@btinternet.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8683
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Andy <andrewjohnshelley@gmail.com>
  • Loading branch information
borneoa committed Jan 12, 2025
1 parent 0ed03df commit 26f2df8
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion contrib/list_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <assert.h>
#include <helper/list.h>

static LIST_HEAD(threads);
static OOCD_LIST_HEAD(threads);

struct thread {
int id;
Expand Down
2 changes: 1 addition & 1 deletion src/helper/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/server/telnet_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ';', '[', '{'
Expand Down
2 changes: 1 addition & 1 deletion src/target/adi_v5_jtag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/target/arm_cti.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/target/arm_dap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/target/arm_tpiu_swo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/target/openrisc/or1k.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/target/riscv/riscv-013.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
6 changes: 3 additions & 3 deletions src/target/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 26f2df8

Please sign in to comment.