这段程序是freertos的一部分。在c编译器中编译通过,在c++编译器中报错。如下
....\FreeRTOS\portable\MemMang\heap_2.c(295): error: #415: no suitable constructor exists to convert from "std::uint8_t *" to "A_BLOCK_LINK"
下面是出错代码
/* xStart is used to hold a pointer to the first item in the list of free
blocks. The void cast is used to prevent compiler warnings. */
// xStart.pxNextFreeBlock = ( void * ) pucAlignedHeap;
xStart.pxNextFreeBlock = static_cast<A_BLOCK_LINK>(pucAlignedHeap);
xStart.xBlockSize = ( size_t ) 0;
这个是他的定义
typedef struct A_BLOCK_LINK
{
struct A_BLOCK_LINK pxNextFreeBlock; /<< The next free block in the list. /
size_t xBlockSize; /<< The size of the free block. */
} BlockLink_t;
/* Create a couple of list links to mark the start and end of the list. */
static BlockLink_t xStart, xEnd;
请问我应该如何修改这一部分?