-
Notifications
You must be signed in to change notification settings - Fork 321
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
Support forward declarations for C-like languages #1028
base: master
Are you sure you want to change the base?
Conversation
The following files are removed - tests/expectations/std_lib_both.c - tests/expectations/std_lib_both.compat.c because opaque type definitions are replaced with forward declarations.
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.
So... I'm not sure why we need a separate set around, it seems generally this should be tracked as part of Dependencies
?
Also, I don't think we should unconditionally create forward declarations for non-problematic cases as you're doing here (anything that is a pointer gets forward-declared).
@@ -687,15 +688,54 @@ impl Type { | |||
generic_params: &GenericParams, | |||
library: &Library, | |||
out: &mut Dependencies, | |||
ptr_types: &mut IndexSet<GenericPath>, | |||
|
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.
nit: space. But also rather than having an is_ptr
param, it seems this should be handled in Type::Ptr
itself?
i'll check your points and modify this PR when i have time. |
Output forward declarations for C-like languages:
Limitations:
--style=type
is specifiedFixes #43