vxworks emulation
Hi,
I encounter a problem with the emulation of vxworks over Xenomai. I need to use FUNCPTR but this function is't implemented the same in Xenomai as in Wind River.
Here is part of wind-river code : (types/vxTypesOld.h)
#ifdef __cplusplus
typedef int (*FUNCPTR) (...); /* ptr to function returning
int */
typedef void (*VOIDFUNCPTR) (...); /* ptr to function returning
void */
typedef double (*DBLFUNCPTR) (...); /* ptr to function returning
double*/
typedef float (*FLTFUNCPTR) (...); /* ptr to function returning
float */
#else
typedef int (*FUNCPTR) (); /* ptr to function returning int
*/
typedef void (*VOIDFUNCPTR) (); /* ptr to function returning
void */
typedef double (*DBLFUNCPTR) (); /* ptr to function returning
double*/
typedef float (*FLTFUNCPTR) (); /* ptr to function returning
float */
#endif /* _cplusplus */
Here is part of vxworks/vxworks.h :
typedef void (*FUNCPTR)(long, long, long, long, long, long, long, long, long, long);
So there is a restriction in the arguments allowed to pass. In fact when I try to compil the following line there are errors (number of arguments and conversion types errors)
char TheCompMes[55];
...
extern FUNCPTR errPtr;
...
errPtr (ERR_ACT_TASK, 0 , PER, 0 , NULL, "cmde_tache", "FastMsgCollector", TheCompMes);
What can I do ?
Thanks in advance
Matthieu
Quoted 5 lines · Matthieu
Hi,
I encounter a problem with the emulation of vxworks over Xenomai. I need to use FUNCPTR but this function is't implemented the same in Xenomai as in Wind River.
Defining:
typedef int (*FUNCPTR) (...);
or
typedef int (*FUNCPTR) (); /* ptr to function returning int
defeats the compiler type checking. It is a really bad idea. In Xenomai vxworks emulation, FUNCPTR is only used to mean a task function pointer. When defining a funciont that will be used by other functions than taskSpawn, simply define your function without declaring as a FUNCPTR pointer, and everything will work.
Signature · 1 line
Gilles.