Skip to content
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 Fortran 2003 bind(c), enum bind(c) #255

Open
raehik opened this issue Feb 8, 2023 · 0 comments
Open

Support Fortran 2003 bind(c), enum bind(c) #255

raehik opened this issue Feb 8, 2023 · 0 comments

Comments

@raehik
Copy link
Collaborator

raehik commented Feb 8, 2023

ICCS's fortran-tf-lib uses it for C interop: src/fortran_tensorflow_lib.F90#L24-L42

    enum, bind(c)
        enumerator :: TF_OK = 0
        enumerator :: TF_CANCELLED = 1
! ...
        enumerator :: TF_DATA_LOSS = 15
    end enum

Some short notes:

  • enum, bind(c) is a nice simple block construct
  • it might look flexible but enum, bind(c) must use that exact form. No plain enum.
  • bind(c) is similar. No other bind(X).
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

No branches or pull requests

1 participant