The ATTRIBUTES directive option ALIAS specifies an alternate external name to be used when referring to external subprograms. It takes the following form:
cDEC$ ATTRIBUTES ALIAS: external-name:: subprogram
c |
Is one of the following: C (or c), !, or *. (See Syntax Rules for Compiler Directives.) |
external-name |
Is a character constant delimited by apostrophes or quotation marks. The character constant is used as is; the string is not changed to uppercase, nor are blanks removed. |
subprogram |
Is an external subprogram. |
The ALIAS option overrides the C (and STDCALL) option. If both C and ALIAS are specified for a subprogram, the subprogram is given the C calling convention, but not the C naming convention. It instead receives the name given for ALIAS, with no modifications.
ALIAS cannot be used with internal procedures, and it cannot be applied to dummy arguments.
The following example gives the subroutine happy the name "_OtherName@4" outside this scoping unit:
INTERFACE
SUBROUTINE happy(i)
!DEC$ ATTRIBUTES STDCALL, DECORATE, ALIAS:'OtherName' :: happy
INTEGER i
END SUBROUTINE
END INTERFACE
cDEC$ ATTRIBUTES ALIAS has the same effect as the cDEC$ ALIAS directive.