将例程的C程序,移至为C++程序,遇到一个问题。
在使用NDK开发包中osif.h提供的方法TaskCreate()时,CSS编译报错,
argument of type "void (*)()" is incompatible with parameter of type "void (*)() C"
请问是调用方式有问题吗?
调用代码如下:()
(void) TaskCreate(UDP_perform_send, "UDPBenchmarkTX", OS_TASKPRIHIGH, 0x1400, 0, 0, 0 );
其中,static void UDP_perform_send() 是UDP发送函数。
Nancy Wang:
看一下Task_create的原型,返回的是句柄,我认为用void定义是矛盾的。
Task_Handle Task_create(Task_FuncPtr fxn, const Task_Params *params, Error_Block *eb);
Task_create creates a new task object. If successful, Task_create returns the handle of the new task object. If unsuccessful, Task_create returns NULL unless it aborts.
,
user4869866:
感谢回复!