api: add C++ friendly version of Z_TIMEOUT_TICKS.
The designated initializer used in Z_TIMEOUT_TICKS causes problems for some C++ parsers (at least in Eclipse). Let's use standard C++ list initialization (C++11 and up) instead. Designated initializatin is going to C++20, so it is not neccessary to apply C++ specific code for that version and up. Signed-off-by: Artur Lipowski <Artur.Lipowski@hidglobal.com>
This commit is contained in:
parent
6ae2374eea
commit
ca61606632
1 changed files with 4 additions and 0 deletions
|
@ -80,7 +80,11 @@ typedef struct {
|
|||
#define K_TIMEOUT_EQ(a, b) ((a).ticks == (b).ticks)
|
||||
|
||||
#define Z_TIMEOUT_NO_WAIT ((k_timeout_t) {})
|
||||
#if defined(__cplusplus) && ((__cplusplus - 0) < 202002L)
|
||||
#define Z_TIMEOUT_TICKS(t) ((k_timeout_t) { (t) })
|
||||
#else
|
||||
#define Z_TIMEOUT_TICKS(t) ((k_timeout_t) { .ticks = (t) })
|
||||
#endif
|
||||
#define Z_FOREVER Z_TIMEOUT_TICKS(K_TICKS_FOREVER)
|
||||
|
||||
#ifdef CONFIG_TIMEOUT_64BIT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue