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

Danny Smith dannysmith@clear.net.nz
Mon Aug 13 01:58:00 GMT 2007


At
http://gcc.gnu.org/ml/fortran/2007-08/msg00179.html

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


Ada does this using a pragma Import (StdCall ...)  mechanism
See ada/decl.c (in particular the huge function gnat_to_gnu_entity where
it says
	if (Has_Stdcall_Convention (gnat_entity))
	  prepend_one_attribute_to
	    (&attr_list, ATTR_MACHINE_ATTRIBUTE,
	     get_identifier ("stdcall"), NULL_TREE,
	     gnat_entity);

Danny



More information about the Fortran mailing list