Skip to content

Commit 9d8ff3c

Browse files
committed
include: sys: atomic: Check for ATOMIC_OPERATIONS_BUILTIN
The code today relied on ATOMIC_OPERATIONS_BUILTIN being the default option if the other alternatives (_C and _ARCH) were not enabled. Instead, explicitly check for it to avoid confusion when browsing the code and to ensure that the user can always match a particular Kconfig option with the #ifdeffery in the header file. Signed-off-by: Carles Cufi <[email protected]>
1 parent df8b43d commit 9d8ff3c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/zephyr/sys/atomic.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ extern "C" {
3535
/* Other arch specific implementation */
3636
# include <zephyr/sys/atomic_arch.h>
3737
# endif /* CONFIG_XTENSA */
38-
#else
38+
#elif defined(CONFIG_ATOMIC_OPERATIONS_BUILTIN)
3939
/* Default. See this file for the Doxygen reference: */
4040
#include <zephyr/sys/atomic_builtin.h>
41+
#else
42+
#error "CONFIG_ATOMIC_OPERATIONS_* not defined"
4143
#endif
4244

4345
/* Portable higher-level utilities: */

0 commit comments

Comments
 (0)