Skip to content

Commit a36995e

Browse files
ottojocarlescufi
authored andcommitted
ring_buffer: fix designated initializer order in RING_BUF_DECLARE
Change order of designated initializers for ring_buf struct in the RING_BUF_DECLARE macro, to match the order in the struct definition. This fixes compilation when using C++, which requires using the same order as in the struct definition. Fixes #45697 Signed-off-by: Jonas Otto <[email protected]>
1 parent a0aa8c7 commit a36995e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/zephyr/sys/ring_buffer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ static inline void ring_buf_internal_reset(struct ring_buf *buf, int32_t value)
7878
RING_BUFFER_SIZE_ASSERT_MSG); \
7979
static uint8_t __noinit _ring_buffer_data_##name[size8]; \
8080
struct ring_buf name = { \
81-
.size = size8, \
82-
.buffer = _ring_buffer_data_##name \
81+
.buffer = _ring_buffer_data_##name, \
82+
.size = size8 \
8383
}
8484

8585
/**

0 commit comments

Comments
 (0)