Skip to content

Commit

Permalink
toolchain: Replace GCC_VERSION, CLANG_VERSION and BUILD_ASSERT macros
Browse files Browse the repository at this point in the history
GCC_VERSION is defined in a few modules, and those headers are often
included first, so replace the one used in zephyr with
TOOLCHAIN_GCC_VERSION. Do the same with CLANG_VERSION, replacing it with
TOOLCHAIN_CLANG_VERSION.

BUILD_ASSERT is also defined in include/toolchain/common.h, which might
get included before gcc.h. We want to use the gcc-specific one instead
of the general one.

Signed-off-by: Keith Packard <[email protected]>
(cherry picked from commit c58c76e)
  • Loading branch information
keith-packard authored and cfriedt committed Dec 19, 2023
1 parent 5d382fa commit ce4c30f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/toolchain/gcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@
#endif


#undef BUILD_ASSERT /* clear out common version */
/* C++11 has static_assert built in */
#ifdef __cplusplus
#if defined(__cplusplus) && (__cplusplus >= 201103L)
#define BUILD_ASSERT(EXPR, MSG...) static_assert(EXPR, "" MSG)

/*
Expand Down

0 comments on commit ce4c30f

Please sign in to comment.