This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Windows dllexport and ISO C binding
- From: Tobias Burnus <burnus at net-b dot de>
- To: Daniel Kraft <d at domob dot eu>
- Cc: Fortran List <fortran at gcc dot gnu dot org>
- Date: Wed, 25 Feb 2009 09:57:44 +0100
- Subject: Re: Windows dllexport and ISO C binding
- References: <49A45BEF.8010507@domob.eu>
Dear Daniel,
Daniel Kraft wrote:
> - The MySQL embedded library uses the
> __declspec(dllexport)
> convention, which means that names are decorated with
> @4, @32 etc.
They are not only decorated by @<byte size of the arguments>, but also
the called (and not the calling) procedure pops the arguments from the
stack (STDCALL). Thus just allowing to use @4 in BIND(C) is not the
right solution.
There is no good resolution for GCC 4.4, but we should really do
something about it in GCC 4.5. (Note: This calling system is only used
by Win32 (mostly system dlls), Win64 uses the normal C calling where the
caller pops the arguments from the stack.)
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34112 and see the
initial patch at http://gcc.gnu.org/ml/fortran/2008-03/msg00007.html
Tobias