-
Notifications
You must be signed in to change notification settings - Fork 509
Registry: add basic ISO_C_BINDING types #2987
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
Registry: add basic ISO_C_BINDING types #2987
Conversation
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.
Pull Request Overview
This PR adds support for basic ISO_C_BINDING types to the OpenFAST registry code generator. The feature allows registry files to include C-compatible data types by adding ISO_C_BINDING as a directive.
- Adds parsing for
ISO_C_BINDINGdirective in registry files - Implements basic C-compatible data types (
c_int,c_float,c_double,c_char) - Generates appropriate USE statements in output Fortran modules
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| registry_parse.cpp | Adds parsing logic to detect ISO_C_BINDING directive and set flag |
| registry_gen_fortran.cpp | Generates USE ISO_C_BINDING statement when flag is set |
| registry.hpp | Adds data structures and logic for C-binding data types |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
to use, add "ISO_C_BINDING" by itself on a line someplace in the registry text file
d9cb736 to
cd90e0c
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
cd8fa39 to
5e851bd
Compare
deslaughter
left a comment
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.
This is a really good addition
Might be ready to merge, if it doesn't need a complete rewrite.
Feature or improvement description
I needed a way to generate some simple registry files containing a limited number of types from the
ISO_C_BINDINGintrinisic library. This ugly mess of code (I have no idea how to code in C/C++) seems to work, but is likely terribly ugly and missing some important things.To use this feature, add
ISO_C_BINDINGby itself on a line someplace in the registry text fileRelated issue, if one exists
N/A
Impacted areas of the software
Registry only. May provide value for generating registries for c-binding libraries (many of those have a messy interface with a mix of c and fortran types arranged in ugly messes of derived types).
This should not change any existing
_Types.f90contents when regenerated.Test results, if applicable
No results affected.