This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
C Interoperability on Windows -- or __cdecl, __stdcall, __fastcall
- From: Tobias Burnus <burnus at net-b dot de>
- To: "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Date: Tue, 07 Aug 2007 21:25:36 +0200
- Subject: 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.