Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

!DEC ATTRIBUTES Q

garylscott1
Beginner
1,171 Views
I see in a lot of commercial applications when they provide a module source containing interfaces for their C library what appear to me to be incomplete definitions.

For example:

!C

__declspec(dllimport) unsigned short OutPortB(unsigned long Port, unsigned char Value);

When they include the attributes, they only include the following:

!DEC ATTRIBUTES C,ALIAS: "__OutPortB" :: OutPortB

I want to include:

!DEC ATTRIBUTES VALUE :: Port
!DEC ATTRIBUTES VALUE :: Value

Do I need those, or does the ATTRIBUTES C take care of that (as an assumed C default)? I prefer to be complete and clear in the definition.

Or am I completely confused?




0 Kudos
1 Reply
Steven_L_Intel1
Employee
1,171 Views
ATTRIBUTES C implies pass-by-value - mostly. There is a table in the documentation that gives the details - some of them are not obvious. Building Applications > Programming with Mixed Languages > Adjusting Calling Conventions > ATTRIBUTES Properties and Calling Conventions. Study it carefully. Some of the attribute effects may seem nonsensical, but they were brought over from Microsoft Fortran PowerStation.
0 Kudos
Reply