From 2ff27e35ce6c95ae493c631e6e59518819073f89 Mon Sep 17 00:00:00 2001 From: wenquan1 Date: Thu, 17 Sep 2026 09:54:32 +0800 Subject: [PATCH] canutils/candump: guard SOF_TIMESTAMPING macros with ifndef candump.c locally defines SOF_TIMESTAMPING_SOFTWARE, SOF_TIMESTAMPING_RX_SOFTWARE and SOF_TIMESTAMPING_RAW_HARDWARE. After nuttx added these macros to sys/socket.h, the build fails with -Werror=redefine. Wrap the local defines with #ifndef guards so they are only used when the system header does not provide them. Signed-off-by: wenquan1 --- canutils/candump/candump.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/canutils/candump/candump.c b/canutils/candump/candump.c index 58958a46f01..515de76bcde 100644 --- a/canutils/candump/candump.c +++ b/canutils/candump/candump.c @@ -79,9 +79,15 @@ #endif /* from #include - since Linux 2.6.30 */ +#ifndef SOF_TIMESTAMPING_SOFTWARE #define SOF_TIMESTAMPING_SOFTWARE (1<<4) +#endif +#ifndef SOF_TIMESTAMPING_RX_SOFTWARE #define SOF_TIMESTAMPING_RX_SOFTWARE (1<<3) +#endif +#ifndef SOF_TIMESTAMPING_RAW_HARDWARE #define SOF_TIMESTAMPING_RAW_HARDWARE (1<<6) +#endif #define MAXSOCK 16 /* max. number of CAN interfaces given on the cmdline */ #define MAXIFNAMES 30 /* size of receive name index to omit ioctls */