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:
Rajavardhan Gundi 2018-04-27 10:15:15 +05:30 committed by Anas Nashif
commit 68040c8d78

View file

@ -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)));
/** @} */