From 5fc96ff9d70f7828b5eada42de04c521cd0904e1 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Fri, 12 Jan 2024 11:40:20 -0800 Subject: [PATCH] sys: atomic_c: skip syscall tracing This skips syscall tracing on atomic_c.h, as the compiler does not like "({ ... tracing code ... })" and complains: error: expected identifier or '(' before '{' token Even though there is already a '(' before '{'. Signed-off-by: Daniel Leung --- include/zephyr/sys/atomic_c.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/zephyr/sys/atomic_c.h b/include/zephyr/sys/atomic_c.h index 0ea6e6dfa34..f1e23caf362 100644 --- a/include/zephyr/sys/atomic_c.h +++ b/include/zephyr/sys/atomic_c.h @@ -72,7 +72,26 @@ __syscall atomic_val_t atomic_nand(atomic_t *target, atomic_val_t value); #endif #ifdef CONFIG_ATOMIC_OPERATIONS_C + +#ifndef DISABLE_SYSCALL_TRACING +/* Skip defining macros of atomic_*() for syscall tracing. + * Compiler does not like "({ ... tracing code ... })" and complains + * + * error: expected identifier or '(' before '{' token + * + * ... even though there is a '(' before '{'. + */ +#define DISABLE_SYSCALL_TRACING +#define _REMOVE_DISABLE_SYSCALL_TRACING +#endif + #include + +#ifdef _REMOVE_DISABLE_SYSCALL_TRACING +#undef DISABLE_SYSCALL_TRACING +#undef _REMOVE_DISABLE_SYSCALL_TRACING +#endif + #endif #endif /* ZEPHYR_INCLUDE_SYS_ATOMIC_C_H_ */