kernel: sem: Modify the way BUILD_ASSERT is used
BUILD_ASSERT() macro makes use of __COUNTER__ which may not be supported in some compilers (like xcc). So, multiple uses of BUILD_ASSERT() in same scope is not possible for such compilers. Instead, the expression to BUILD_ASSERT can be "&&"ed to achieve the same purpose. Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
This commit is contained in:
parent
7db4d5699e
commit
68040c8d78
1 changed files with 2 additions and 2 deletions
|
@ -2705,8 +2705,8 @@ static inline unsigned int _impl_k_sem_count_get(struct k_sem *sem)
|
|||
struct k_sem name \
|
||||
__in_section(_k_sem, static, name) = \
|
||||
_K_SEM_INITIALIZER(name, initial_count, count_limit); \
|
||||
BUILD_ASSERT((count_limit) != 0); \
|
||||
BUILD_ASSERT((initial_count) <= (count_limit));
|
||||
BUILD_ASSERT(((count_limit) != 0) && \
|
||||
((initial_count) <= (count_limit)));
|
||||
|
||||
/** @} */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue