This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C Interoperability on Windows -- or __cdecl, __stdcall, __fastcall


Hi all,

on the GNU-Fortran@googlegroups list (gfortran user list) there was the
question how to access the Windows' ABI function from Fortran.

Using the ISO C Bindings helps in principle, but Windows has another
speciality: It uses the __stdcall calling conventions whereas gfortran
uses the __cdecl, calling convention. Cf. 
http://www.codeproject.com/cpp/calling_conventions_demystified.asp

The question is now: How to tell the compiler to generate a call to a  C
function using this special calling convention?


Lahey seemingly has a "DLL_IMPORT FunctionName" statement, one could
also enhance BIND(c [, name=...]) by a
"callingconvention="[cdecl,stdcall,fastcall]", or ?

What do you think?

Tobias,
who does not have much Windows programming experience.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]