This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/34112] Add $!DEC ATTRIBUTE support for 32bit Windows' STDCALL



------- Comment #4 from fxcoudert at gcc dot gnu dot org  2008-02-05 10:17 -------
(In reply to comment #0)
> As the standard makes not provisions and !DEC$ (*DEC$, cDEC$) is widely used,
> gfortran should accept the following:
> 
>   function CallWndRetProc(nCode, wParam, lParam)
>   !DEC$ ATTRIBUTES STDCALL,DECORATE, ALIAS: 'CallWndRetProc' :: CallWndRetProc 
>   end function

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:  
BIND(C,STDCALL). It is the logical place to put it, but it has to be protected
by macros to compile on other compilers, which is not very Fortran-ish.

So, my next idea is to provide an compile-time option that would make all
BIND(C) procedures in the compiled file STDCALL: true, this does not solve the
problem of existing code, and true, it requires creating different source files
if you want to use mixed calling conventions, but it seems like an good
alternative to satisfy our Windows power users and yet not add too much extra
kludge to the front-end.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34112


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