This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Dll entry point aliasing
- From: Tobias Burnus <burnus at net-b dot de>
- To: John Barnes <johnbarnes2858 at gmail dot com>, fortran at gcc dot gnu dot org
- Date: Sun, 22 Jun 2014 22:10:27 +0200
- Subject: Re: Dll entry point aliasing
- Authentication-results: sourceware.org; auth=none
- References: <CAPEbvBW4E6byMSxFeSAL8gr7k0AKKsVrx4diQdUAADzrmt9cwQ at mail dot gmail dot com>
John Barnes wrote:
subroutine XXXX_ENGINE_INITIALISE(args, success_code)
!DEC$ ATTRIBUTES DLLEXPORT :: XXXX_ENGINE_INITIALISE
!DEC$ ATTRIBUTES ALIAS:'_XXXX_ENGINE_INITIALISE' ::
XXXX_ENGINE_INITIALISE
character(*), intent(in) :: args
integer, intent(out) :: success_code ! 0: ok, -ive fatal error, +ive warning
As Jenne has mentioned, we use Fortran 2003's C binding support for name
of the function â which is additionally dressed according to the
platform ABI; only the dllexport is beyond Fortran 2003 and uses a GCC
directive.
For your program, it would be (with cdecl):
subroutine XXXX_ENGINE_INITIALISE(args, success_code) &
BIND(C, name="_XXXX_ENGINE_INITIALISE")
!GCC$ attributes dllexport :: XXXX_ENGINE_INITIALISE
The string arument would have to be modified to
character(len=1), dimension(*)
and possibly you need to add a trailing hidden string-length argument I
don't know how you currently handle it.
Cf. https://gcc.gnu.org/onlinedocs/gfortran/Mixed-Language-Programming.html
Tobias