This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 6e12c3de7 canutils/candump: guard SOF_TIMESTAMPING macros with ifndef
6e12c3de7 is described below
commit 6e12c3de75732bba1359a2e0db8a14c07e4493cd
Author: wenquan1 <[email protected]>
AuthorDate: Thu Sep 17 09:54:32 2026 +0800
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 <[email protected]>
---
canutils/candump/candump.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/canutils/candump/candump.c b/canutils/candump/candump.c
index 58958a46f..515de76bc 100644
--- a/canutils/candump/candump.c
+++ b/canutils/candump/candump.c
@@ -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 */