Skip to content

Conversation

mikesteele81
Copy link
Contributor

These changes fix #88.

The extractCallingConvention function should check for any calling
convention attributes inside function pointer declarators.
Dynamic foreign imports are generated by c2hs whenever C function
pointers need to be called. Function pointer declarations may contain
attributes which specify a calling convention to be used.

This patch Applies changes made in
a3ac24e1c7d3f2ec542364643f4346caba1a4915 to the case of "dynamic"
foreign imports.
@ian-ross
Copy link
Member

Thanks! I'll look at this in the next couple of days.

@ian-ross ian-ross merged commit 49f5fa7 into haskell:master Aug 3, 2014
@ian-ross
Copy link
Member

ian-ross commented Aug 3, 2014

@mikesteele81 This looks good. Thanks! I need to make sure that the regression suite I run on Travis works OK, but I can't see any reason that it shouldn't. I don't do any testing on Windows myself, so I'm relying on you for that!

@mikesteele81 mikesteele81 deleted the calling_convention branch August 4, 2014 00:58
@mikesteele81
Copy link
Contributor Author

Thanks for pulling this. I'm working on a binding where C structures containing function pointers need to be called from Haskell. C2hs's code base is unfamiliar to me, so I wasn't certain that these changes would have the intended effect without causing problems elsewhere.

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

Successfully merging this pull request may close these issues.

Support calling convention attributes in function pointer declarations

2 participants