]> www.infradead.org Git - users/borneoa/openocd-next.git/commitdiff
helper: list: rename macro clashing with sys/queue.h
authorAntonio Borneo <borneo.antonio@gmail.com>
Tue, 31 Dec 2024 13:47:02 +0000 (14:47 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sun, 12 Jan 2025 11:09:31 +0000 (11:09 +0000)
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>
contrib/list_example.c
src/helper/list.h
src/server/telnet_server.c
src/target/adi_v5_jtag.c
src/target/arm_cti.c
src/target/arm_dap.c
src/target/arm_tpiu_swo.c
src/target/openrisc/or1k.c
src/target/riscv/riscv-013.c
src/target/target.c

index 4fcfcdf348a8f30b5f0c91ab4835b154314d89af..1f28dc2dbdf3767987e54aca27bae49a63defebe 100644 (file)
@@ -12,7 +12,7 @@
 #include <assert.h>
 #include <helper/list.h>
 
-static LIST_HEAD(threads);
+static OOCD_LIST_HEAD(threads);
 
 struct thread {
        int id;
index 47290c26027f7e35305c2a82a14a6c8c1df6197b..ba07f155683c6e2bf76cf26b8344125e7713e850 100644 (file)
@@ -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
index 7818af2dbbb1cb0e2845f64b82e9b9deb61edc17..2c3f769801aa2682d4a1ede2aab0ddbecb034acf 100644 (file)
@@ -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 ';', '[', '{'
index fee1a248587afc0d335bdbbab5a76114c10cf53d..c9ed5b948b089ba322c3758fdad5875bf22c72b4 100644 (file)
@@ -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();
index 88eec832ef5cf45aab4ba93b6b28fe2d586213cd..b2f78eef7840cd16944d66f73f3c885c4b985b61 100644 (file)
@@ -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)
 {
index 9f4afae74372b2c287fa935094224a830cfc88eb..c5bd6ccd4da6243e0f8ea9e8e5565a94913790c6 100644 (file)
@@ -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;
 
index c14fd5fc8427d5fd8dbe82feb1187924cc19b60d..e20cd59272a817a348a3d7f2bddfe3be2d3dea39 100644 (file)
@@ -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
 
index 8c386108057e4292cde7a8e2bc5fef46a6049882..efc076c9999aafc55a435d7e7320538b34fab36b 100644 (file)
@@ -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);
index 658c1fd9db1d9a247c59c3f78a252c039afd9b93..bb450ce623f3e79aa6319161009941c04a81d354 100644 (file)
@@ -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)
 {
index 1fc8baf2c08f6d928ddc20bcfa8425df9d7a8ace..8deab8f34d9cfd62e8c527ae7cac9c629612fd85 100644 (file)
@@ -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,