Closed rcoacci closed 5 years ago
On a similar note, the same thing happens for fundamental pointer types (int, long, etc). It seems the problem is in fundamental.swg :
%typemap(bindc, in="$typemap(imtype, $*1_ltype)") FORTRAN_INTRINSIC_TYPE&
should be
%typemap(bindc, in="$typemap(imtype, $*1_ltype), value") FORTRAN_INTRINSIC_TYPE&
As $typemap(imtype, $*1_ltype)
for FORTRAN_INTRINSIC_TYPE&
is type(C_PTR)
Note that the imtype
typemap in defined correctly for dummy arguments.
I think this too is a consequence of https://github.com/swig-fortran/swig/pull/123 . I'll take a look
Suppose I have the following interface file (example.i):
The generated interface file (example.f90) is:
Notice that the dummy argument
foo
is declared astype(C_PTR)
which is incorrect, as it should betype(C_PTR), value
.I believe the problem is in
classes.swg:322
where you state:%typemap(bindc) SWIGTYPE* "type(C_PTR)";
It should be:
%typemap(bindc, in="type(C_PTR), value") SWIGTYPE* "type(C_PTR)";