Skip to content

Commit 26f2df8

Browse files
committed
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 <[email protected]> Reported-by: Andrew Shelley <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8683 Tested-by: jenkins Reviewed-by: Tomas Vanek <[email protected]> Reviewed-by: Andy <[email protected]>
1 parent 0ed03df commit 26f2df8

File tree

10 files changed

+13
-13
lines changed

10 files changed

+13
-13
lines changed

contrib/list_example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <assert.h>
1313
#include <helper/list.h>
1414

15-
static LIST_HEAD(threads);
15+
static OOCD_LIST_HEAD(threads);
1616

1717
struct thread {
1818
int id;

src/helper/list.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct list_head {
4646

4747
#define LIST_HEAD_INIT(name) { &(name), &(name) }
4848

49-
#define LIST_HEAD(name) \
49+
#define OOCD_LIST_HEAD(name) \
5050
struct list_head name = LIST_HEAD_INIT(name)
5151

5252
static inline void

src/server/telnet_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ static void telnet_auto_complete(struct connection *connection)
570570
struct list_head lh;
571571
};
572572

573-
LIST_HEAD(matches);
573+
OOCD_LIST_HEAD(matches);
574574

575575
/* - user command sequence, either at line beginning
576576
* or we start over after these characters ';', '[', '{'

src/target/adi_v5_jtag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ static int jtagdp_overrun_check(struct adiv5_dap *dap)
431431
struct dap_cmd *el, *tmp, *prev = NULL;
432432
int found_wait = 0;
433433
int64_t time_now;
434-
LIST_HEAD(replay_list);
434+
OOCD_LIST_HEAD(replay_list);
435435

436436
/* make sure all queued transactions are complete */
437437
retval = jtag_execute_queue();

src/target/arm_cti.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct arm_cti {
2525
struct adiv5_ap *ap;
2626
};
2727

28-
static LIST_HEAD(all_cti);
28+
static OOCD_LIST_HEAD(all_cti);
2929

3030
const char *arm_cti_name(struct arm_cti *self)
3131
{

src/target/arm_dap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "transport/transport.h"
1919
#include "jtag/interface.h"
2020

21-
static LIST_HEAD(all_dap);
21+
static OOCD_LIST_HEAD(all_dap);
2222

2323
extern struct adapter_driver *adapter_driver;
2424

src/target/arm_tpiu_swo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ struct arm_tpiu_swo_priv_connection {
126126
struct arm_tpiu_swo_object *obj;
127127
};
128128

129-
static LIST_HEAD(all_tpiu_swo);
129+
static OOCD_LIST_HEAD(all_tpiu_swo);
130130

131131
#define ARM_TPIU_SWO_TRACE_BUF_SIZE 4096
132132

src/target/openrisc/or1k.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
#include "or1k.h"
2828
#include "or1k_du.h"
2929

30-
LIST_HEAD(tap_list);
31-
LIST_HEAD(du_list);
30+
OOCD_LIST_HEAD(tap_list);
31+
OOCD_LIST_HEAD(du_list);
3232

3333
static int or1k_remove_breakpoint(struct target *target,
3434
struct breakpoint *breakpoint);

src/target/riscv/riscv-013.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ typedef struct {
214214
dm013_info_t *dm;
215215
} riscv013_info_t;
216216

217-
static LIST_HEAD(dm_list);
217+
static OOCD_LIST_HEAD(dm_list);
218218

219219
static riscv013_info_t *get_info(const struct target *target)
220220
{

src/target/target.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ struct target *all_targets;
108108
static struct target_event_callback *target_event_callbacks;
109109
static struct target_timer_callback *target_timer_callbacks;
110110
static int64_t target_timer_next_event_value;
111-
static LIST_HEAD(target_reset_callback_list);
112-
static LIST_HEAD(target_trace_callback_list);
111+
static OOCD_LIST_HEAD(target_reset_callback_list);
112+
static OOCD_LIST_HEAD(target_trace_callback_list);
113113
static const int polling_interval = TARGET_DEFAULT_POLLING_INTERVAL;
114-
static LIST_HEAD(empty_smp_targets);
114+
static OOCD_LIST_HEAD(empty_smp_targets);
115115

116116
enum nvp_assert {
117117
NVP_DEASSERT,

0 commit comments

Comments
 (0)