-
Notifications
You must be signed in to change notification settings - Fork 67
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
FFI: Static types for references to Nit objects from C code #2348
Conversation
Signed-off-by: Alexis Laferrière <[email protected]>
Signed-off-by: Alexis Laferrière <[email protected]>
Signed-off-by: Alexis Laferrière <[email protected]>
Signed-off-by: Alexis Laferrière <[email protected]>
Signed-off-by: Alexis Laferrière <[email protected]>
Signed-off-by: Alexis Laferrière <[email protected]>
Signed-off-by: Alexis Laferrière <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good but a lot of tests fail
There's an issue with the order of the generated code. I'll have to update support for callbacks from C, C++ and Objective-C. |
test this please |
too many conflicts now. :( |
This PR brings back a feature from the old nitc, generated static C types for references to Nit objects in user C code. These types are used only when the Nit type doesn't have a direct association in C, like interfaces, standard classes and nullable types, but extern classes and primitive types still use their associated C types. These generated types are used as parameters and return type of extern methods, and in the signature of callbacks to Nit services.
The static types extends some of the static type safety from Nit to the user C code. It lets the C compiler detect some data manipulation errors.
These types are also used by the FFI with C++ and Objective-C.
Also fix the support of generic extern classes, update the style of some FFI code, and fix #2277.