File tree Expand file tree Collapse file tree 4 files changed +26
-3
lines changed Expand file tree Collapse file tree 4 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 11set_directory_properties (PROPERTIES LABELS bool )
22
3- add_library (bool_fortran lib.f90)
3+ add_library (bool_fortran OBJECT lib.f90)
44
55add_executable (c_fortran_bool main.c)
66target_link_libraries (c_fortran_bool PRIVATE bool_fortran)
Original file line number Diff line number Diff line change 11set_directory_properties (PROPERTIES LABELS opaque)
22
3- add_library (opaque_fortran lib.f90)
3+ add_library (opaque_fortran OBJECT lib.f90)
4+
5+ add_executable (c_opaque main.c)
6+ target_link_libraries (c_opaque PRIVATE opaque_fortran)
7+ add_test (NAME C_Fortran_opaque COMMAND c_opaque)
48
59add_executable (cpp_opaque main.cpp)
610target_link_libraries (cpp_opaque PRIVATE opaque_fortran)
Original file line number Diff line number Diff line change 1+ // passing a Fortran-only type to/from C where only Fortran operates on opaque type
2+ #include <stdio.h>
3+
4+ extern void init_opaque_C (void * * );
5+
6+ extern void use_opaque_C (void * * );
7+
8+ int main (){
9+
10+ void * myf ;
11+
12+ init_opaque_C (& myf );
13+
14+ use_opaque_C (& myf );
15+
16+ printf ("OK: opaque\n" );
17+
18+ return 0 ;
19+ }
Original file line number Diff line number Diff line change 1- set_directory_properties (PROPERTIES LABELS opaque )
1+ set_directory_properties (PROPERTIES LABELS pointer )
22
33add_library (pointer_fortran OBJECT lib.f90)
44
You can’t perform that action at this time.
0 commit comments