Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cpp_bindgen/generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ namespace cpp_bindgen {
void generate_fortran_interface(std::ostream &strm, std::string const &module_name) {
strm << "! This file is generated!\n";
strm << "module " << module_name << "\n";
strm << "use iso_c_binding\n"; // pgi wants to have this
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this be needed only for PGI or is it good for all the other compilers, too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pgi wants it, all others don’t care.

strm << "implicit none\n";
strm << " interface\n\n";
strm << _impl::get_entities<_impl::fortran_bindings_traits>();
Expand Down
1 change: 1 addition & 0 deletions tests/regression/array/bindgen_regression_array.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
! This file is generated!
module bindgen_regression_array
use iso_c_binding
implicit none
interface

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
! This file is generated!
module bindgen_regression_array_gt_legacy
use iso_c_binding
implicit none
interface

Expand Down
1 change: 1 addition & 0 deletions tests/regression/simple/bindgen_regression_simple.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
! This file is generated!
module bindgen_regression_simple
use iso_c_binding
implicit none
interface

Expand Down
1 change: 1 addition & 0 deletions tests/unit_tests/test_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ void test_cpp_bindgen_and_wrapper_compatible_type_b(bindgen_fortran_array_descri

const char expected_fortran_interface[] = R"?(! This file is generated!
module my_module
use iso_c_binding
implicit none
interface

Expand Down
1 change: 1 addition & 0 deletions tests/unit_tests/test_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ void qux(int, bindgen_fortran_array_descriptor*);

const char expected_fortran_interface[] = R"?(! This file is generated!
module my_module
use iso_c_binding
implicit none
interface

Expand Down