The following summarizes how to reconcile names between languages:
If you call a Fortran routine that uses Fortran defaults and cannot recompile the Fortran code, then in C you must use an all-uppercase name to make the call. In MASM you must either use an all-uppercase name or set the OPTION CASEMAP directive to ALL, which translates all identifiers to uppercase. Use of the __stdcall convention in C code or STDCALL in MASM PROTO and PROC declarations is not enough, because __stdcall and STDCALL always preserve case in these languages. Fortran generates all-uppercase names by default and the C or MASM code must match it.
For example, these prototypes establish the Fortran function FFARCTAN(angle) where the argument angle has the ATTRIBUTES VALUE property:
extern float FFARCTAN( float angle );
.MODEL FLAT
FFARCTAN PROTO, angle: REAL4
...
FFARCTAN PROC, angle: REAL4
If the name of the routine appears as all lowercase in C or assembly,
then naming conventions are automatically correct. Any case may be used
in the Fortran source code, including mixed case since the name is changed
to all lowercase.
In Linux/Mac OS Assembly, the following establishes the Fortran function
ffarctan:
#--Begin ffarctan_
.globl ffarctan_
If the name of a routine appears as mixed-case in C or MASM and you need to preserve the case, use the Fortran ATTRIBUTES ALIAS option.
To use the ALIAS option, place the name in quotation marks exactly
as it is to appear in the object file.
The following is an example for referring to the C function My_Proc:
!DEC$
ATTRIBUTES DECORATE,ALIAS:'My_Proc' :: My_Proc
This example uses DECORATE to automatically reconcile the external name for the target platform.