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

Re: Dll entry point aliasing


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


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