ble_mesh: stack: fix the structure init order to meet C++ requirements

This commit is contained in:
InfiniteYuan
2022-08-16 17:48:04 +08:00
committed by YuanMingFu
parent a047d5d097
commit 8191f319a3
7 changed files with 1133 additions and 42 deletions

View File

@@ -17,6 +17,7 @@
#include <stddef.h>
#include "esp_bit_defs.h"
#include "mesh/types.h"
#include "utils_loops.h"
#ifdef __cplusplus
extern "C" {
@@ -180,6 +181,40 @@ extern "C" {
*/
#define Z_IS_ENABLED3(ignore_this, val, ...) val
/* Used to remove brackets from around a single argument. */
#define __DEBRACKET(...) __VA_ARGS__
#define UTIL_CAT(a, ...) UTIL_PRIMITIVE_CAT(a, __VA_ARGS__)
#define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
/**
* @brief Generates a sequence of code with configurable separator.
*
* Example:
*
* #define FOO(i, _) MY_PWM ## i
* { LISTIFY(PWM_COUNT, FOO, (,)) }
*
* The above two lines expand to:
*
* { MY_PWM0 , MY_PWM1 }
*
* @param LEN The length of the sequence. Must be an integer literal less
* than 255.
* @param F A macro function that accepts at least two arguments:
* <tt>F(i, ...)</tt>. @p F is called repeatedly in the expansion.
* Its first argument @p i is the index in the sequence, and
* the variable list of arguments passed to LISTIFY are passed
* through to @p F.
*
* @param sep Separator (e.g. comma or semicolon). Must be in parentheses;
* this is required to enable providing a comma as separator.
*
* @note Calling LISTIFY with undefined arguments has undefined
* behavior.
*/
#define LISTIFY(LEN, F, sep, ...) UTIL_CAT(Z_UTIL_LISTIFY_, LEN)(F, sep, __VA_ARGS__)
const char *bt_hex(const void *buf, size_t len);
void mem_rcopy(uint8_t *dst, uint8_t const *src, uint16_t len);