Declaring C to Fortran ILC

A #pragma linkage directive is required for C to call Fortran and for Fortran to call C. All entry declarations are made in the C code; no special declaration is required in the Fortran routine. The directive allows the C routine to pass arguments and return values to and from the Fortran routine using an internal argument list compatible with Fortran.

The #pragma linkage directive has the following format:

#pragma linkage(identifier, FORTRAN[, RETURNCODE])

identifier is either the name of the Fortran routine (a function or subroutine), a C function, or, for dynamic calls, the name of a typedef that refers to a Fortran routine.

RETURNCODE is optional and applies only to a called Fortran routine: it specifies that identifier is a Fortran routine that returns an alternate return code to the C routine.