include: improve compatibility with C++ apps.
This patch lets a C++ application use more of Zephyr by adding guards and changeing some constructs to the C++11 equivalent. Changes include: - Adding guards - Switching to static_assert - Switching to a template for ARRAY_SIZE as g++ doesn't have the builtin. - Re-ordering designated initialisers to match the struct field order as G++ only supports simple designated initialisers. Signed-off-by: Michael Hope <mlhx@google.com>
This commit is contained in:
parent
835ee3fff0
commit
5f67a6119d
13 changed files with 135 additions and 59 deletions
|
@ -1549,8 +1549,8 @@ struct k_queue {
|
|||
|
||||
#define _K_QUEUE_INITIALIZER(obj) \
|
||||
{ \
|
||||
.wait_q = SYS_DLIST_STATIC_INIT(&obj.wait_q), \
|
||||
.data_q = SYS_SLIST_STATIC_INIT(&obj.data_q), \
|
||||
.wait_q = SYS_DLIST_STATIC_INIT(&obj.wait_q), \
|
||||
_POLL_EVENT_OBJ_INIT(obj) \
|
||||
_OBJECT_TRACING_INIT \
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue