Cygwin, gfortran and C interop
Tobias Burnus
burnus@net-b.de
Mon Jun 1 08:30:00 GMT 2009
Anthony Stone wrote:
> but the OpenGL library in /lib/w32api/libopengl32.a provides
> '_glBegin@4':
> [...]
> SUBROUTINE glBegin(mode) BIND(C,NAME="glBegin")
> [...]
> Can I modify the interface to persuade gfortran to generate the right
> reference? The Nag compiler provides the possibility of modifying the
> interface to
> SUBROUTINE glBegin(mode) BIND(C,NAME="__stdcall glBegin")
No, currently STDCALL is not supported. There were plans to do so, but
so far there was no patch :-(
Using NAME="__stdcall ..." is an interesting idea; before I have only
seen Visual Fortran's
!DEC$, cf. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34112
The design does not look as clean as, e.g.
BIND(C,convention="stdcall",name="glBegin")
but at least it fits better into the current C binding system as !DEC$.
Can you give a reference to name="__stdcall glBegin" ? I cannot find it
in the documentation of NAG; or is this a side effect of NAG f95
producing C code?
In any case, we should finally do something about it.
Tobias
More information about the Fortran
mailing list