Skip to content

Conversation

@andrew-platt
Copy link
Collaborator

@andrew-platt andrew-platt commented Sep 7, 2025

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_BINDING intrinisic 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_BINDING by itself on a line someplace in the registry text file

Related 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.f90 contents when regenerated.

Test results, if applicable
No results affected.

Copy link
Contributor

Copilot AI left a 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_BINDING directive 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
@andrew-platt andrew-platt force-pushed the f/registry_isocbinding branch from d9cb736 to cd90e0c Compare September 7, 2025 23:27
andrew-platt and others added 4 commits September 7, 2025 17:32
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@andrew-platt andrew-platt force-pushed the f/registry_isocbinding branch from cd8fa39 to 5e851bd Compare September 8, 2025 16:03
Copy link
Collaborator

@deslaughter deslaughter left a 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

@andrew-platt andrew-platt merged commit a4df9c0 into OpenFAST:dev Sep 8, 2025
12 checks passed
@andrew-platt andrew-platt deleted the f/registry_isocbinding branch September 10, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants