Skip to content

Commit ce4c30f

Browse files
keith-packardcfriedt
authored andcommitted
toolchain: Replace GCC_VERSION, CLANG_VERSION and BUILD_ASSERT macros
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)
1 parent 5d382fa commit ce4c30f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/toolchain/gcc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@
4848
#endif
4949

5050

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

5556
/*

0 commit comments

Comments
 (0)