Merge branch 'bugfix/ble_mesh_fix_compile_error_with_cpp_4.1' into 'release/v4.1'
ble_mesh: Fix compile error with c++ files (v4.1) See merge request espressif/esp-idf!7583
This commit is contained in:
commit
e8d33e4faf
1 changed files with 8 additions and 5 deletions
|
@ -400,14 +400,17 @@ int _compare(const uint8_t *a, const uint8_t *b, size_t size);
|
||||||
*/
|
*/
|
||||||
static inline void sys_memcpy_swap(void *dst, const void *src, size_t length)
|
static inline void sys_memcpy_swap(void *dst, const void *src, size_t length)
|
||||||
{
|
{
|
||||||
__ASSERT(((src < dst && (src + length) <= dst) ||
|
u8_t *pdst = (u8_t *)dst;
|
||||||
(src > dst && (dst + length) <= src)),
|
const u8_t *psrc = (const u8_t *)src;
|
||||||
"Source and destination buffers must not overlap");
|
|
||||||
|
|
||||||
src += length - 1;
|
__ASSERT(((psrc < pdst && (psrc + length) <= pdst) ||
|
||||||
|
(psrc > pdst && (pdst + length) <= psrc)),
|
||||||
|
"Source and destination buffers must not overlap");
|
||||||
|
|
||||||
|
psrc += length - 1;
|
||||||
|
|
||||||
for (; length > 0; length--) {
|
for (; length > 0; length--) {
|
||||||
*((u8_t *)dst++) = *((u8_t *)src--);
|
*pdst++ = *psrc--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue