kernel: Fix _K_QUEUE_INITIALIZER portability issue.

_K_QUEUE_INITIALIZER macro provides initialisation for k_queue struct,
which contains an anonymous union.

Older versions of GCC (<= 4.5), even when compiling with -std=gnu99,
do not allow specifying members of an anonymous union without braces
in an initialiser, so it is necessary to add braces around anonymous
union members.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
Stephanos Ioannidis 2019-09-11 18:09:49 +09:00 committed by Anas Nashif
commit f628dcd83b

View file

@ -1839,8 +1839,11 @@ struct k_queue {
#define _K_QUEUE_INITIALIZER(obj) \
{ \
.data_q = SYS_SLIST_STATIC_INIT(&obj.data_q), \
.lock = { }, \
{ \
.wait_q = Z_WAIT_Q_INIT(&obj.wait_q), \
_POLL_EVENT_OBJ_INIT(obj) \
}, \
_OBJECT_TRACING_INIT \
}