Skip to content

Commit

Permalink
sys: atomic_c: skip syscall tracing
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dcpleung authored and nashif committed Jan 13, 2024
1 parent 7fedc81 commit 5fc96ff
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions include/zephyr/sys/atomic_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <syscalls/atomic_c.h>

#ifdef _REMOVE_DISABLE_SYSCALL_TRACING
#undef DISABLE_SYSCALL_TRACING
#undef _REMOVE_DISABLE_SYSCALL_TRACING
#endif

#endif

#endif /* ZEPHYR_INCLUDE_SYS_ATOMIC_C_H_ */

0 comments on commit 5fc96ff

Please sign in to comment.