Skip to content

Comments

Remove ffi tuple example#161

Merged
jemc merged 2 commits intoponylang:masterfrom
Theodus:ffi-tuples
Oct 24, 2016
Merged

Remove ffi tuple example#161
jemc merged 2 commits intoponylang:masterfrom
Theodus:ffi-tuples

Conversation

@Theodus
Copy link
Contributor

@Theodus Theodus commented Oct 23, 2016

This change reflects the changes about to be made in order to resolve ponylang/ponyc#1240

@jemc
Copy link
Member

jemc commented Oct 23, 2016

This isn't quite right. The setEvent example which you changed should actually still work as shown in the current tutorial - we're only talking about disallowing returning a pony tuple from an FFI call.

So it's the getEvent example (that you didn't change) which will no longer work - it would need to be returning an EGLEvent* rather than an EGLEvent in order to work.

I recommend that we just remove the getEvent example, leave the setEvent example as is, and note that FFI calls which return structs by value are not portable enough and consistent enough across compilers to be supported. Perhaps we should also change the title of "pass C structs" to "pass C structs by value" to emphasize that there is another (non-tuple) mechanism for passing and returning structs by reference.

@jemc
Copy link
Member

jemc commented Oct 24, 2016

Thank you!

@jemc jemc merged commit 7b951e8 into ponylang:master Oct 24, 2016
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.

using tuples to describe C structures from FFI doesn't seem to work

2 participants