Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

iso_c_binding question

Sergei_M_
Beginner
591 Views

Hi,

What would be the right interface to call

void InitWELLRNG44497a(unsigned int *);
extern double (*WELLRNG44497a)(void);

from fortran? I have chased C_FUNPTR without success.

0 Kudos
1 Reply
TimP
Honored Contributor III
591 Views

That looks like an ordinary procedure, not a pointer to one.

interface

subroutine InitWELLRNG44497a(i) bind(c,name='InitWELLRNG44497a')

     integer(c_int) :: i

end subroutine InitWELLRNG44497a

end interface

In the absence of value attribute, a pointer to the argument will be constructed automatically, for ABI where it is appropriate (including Intel platforms).  inout will be assumed, which seems likely to be appropriate.

0 Kudos
Reply