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 <wenquan1@xiaomi.com>
This commit is contained in:
wenquan1 2026-09-17 09:54:32 +08:00 • committed by Xiang Xiao
parent e3e3933138
commit 6e12c3de75

View file

@ -79,9 +79,15 @@
#endif
/* from #include <linux/net_tstamp.h> - 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 */