This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34112] Add $!DEC ATTRIBUTE support for 32bit Windows' STDCALL
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Feb 2008 15:12:01 -0000
- Subject: [Bug fortran/34112] Add $!DEC ATTRIBUTE support for 32bit Windows' STDCALL
- References: <bug-34112-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from burnus at gcc dot gnu dot org 2008-02-05 15:12 -------
> I thought a bit about that recently, and I don't like the idea of having to
> support parts of another vendor's extension. The first other idea I had was to
> add that STDCALL specification as an extension to the BIND syntax:
If we don't follow !$DEC than I'm in favor of this variant, which one could
implement even if one implements !$DEC at some point.
> So, my next idea is to provide an compile-time option that would make all
> BIND(C) procedures in the compiled file STDCALL
I'm really against this; I think this is very confusing and makes it very hard
to combine STDCALL with non-STDCALL procedures.
#if defined __GFORTRAN__
#define STDCALL STDCALL
#else
#define STDCALL C
#endif
subroutine my() bind(STDCALL,name="foo")
Or alternatively, though more difficult to CPP:
subroutine my() bind(C,attribute="stdcall",name="foo")
where one could think of allowing other items from
http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34112