Skip to content
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

#get hooks cannot deduce the return pointer type #247

Closed
poscat0x04 opened this issue Feb 21, 2020 · 1 comment
Closed

#get hooks cannot deduce the return pointer type #247

poscat0x04 opened this issue Feb 21, 2020 · 1 comment

Comments

@poscat0x04
Copy link

poscat0x04 commented Feb 21, 2020

Suppose I have a struct defined like this:

typedef struct _alpm_depmissing_t {
        char *target;
        alpm_depend_t *depend;
        char *causingpkg;
} alpm_depmissing_t;

alpm_depend_t is already associated with a Haskell type using the #pointer hook:

data AlpmDepend
{#pointer *alpm_depend_t AlpmDependPtr -> AlpmDepend #} 

now I define a accessor using the #get hook:

getDep = {#get struct alpm_depmissint_t.depend #} 

this is the code generated by c2hs:

getDep = (\ptr -> do {C2HSImp.peekByteOff ptr 8 :: IO (C2HSImp.Ptr ())})

but the return type should be AlpmDependPtr (Ptr AlpmDepend) instead of Ptr ()

@poscat0x04
Copy link
Author

nvm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant