-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coping with C pointers to functions #188
Comments
Could you send please include the an example of how the declaration of the function looks like in the header file. |
The C header file declaration of the function is: struct dvb_v5_descriptors *dvb_scan_transponder(struct dvb_v5_fe_parms *parms,
struct dvb_entry *entry,
int dmx_fd,
check_frontend_t *check_frontend,
void *args,
unsigned other_nit,
unsigned timeout_multiply); so I am now wondering why the post dstep declaration is: dvb_v5_descriptors* dvb_scan_transponder (
dvb_v5_fe_parms* parms,
dvb_entry* entry,
int dmx_fd,
int function () check_frontend,
void* args,
uint other_nit,
uint timeout_multiply); |
Can you include the exact declaration of |
typedef int (check_frontend_t)(void *args, struct dvb_v5_fe_parms *parms); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Playing with libdvbv5 still: I am having a problem with function pointers. In the C code a function is declared:
however, the
check_frontend
project has to be a function with signature:there is a type
check_frontend_t
but the declaration ofdvb_scan_transponder
seems not to use it, which is very C obviously. It means though I end up with the error:For which D seems to offer no solution since
cast(extern (C) int function())
is not a valid cast.Obviously the hack of the moment is to manually change the declaration, but I suspect the solution is to correct the upstream source. I guess I am flagging this in case someone knows a workaround.
The text was updated successfully, but these errors were encountered: