- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Suppose we have a derived type
module this_mod
type :: this_type
integer :: foo
contains
procedure :: bar
end type this_type
interface this_type
module procedure :: constructThis
end interface this_type
contains
function constructThis() result(This)
!DEC$ ATTRIBUTES DLLEXPORT :: constructThis
type(this_type) :: This
end function constructThis
end module this_mod
Is this a proper way to export the constructor of this_type? or should the exported name be the same as the derived type's name this_type?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A. King wrote:.. or should the exported name be the same as the derived type's name this_type?
You should be able to use ALIASing facility with !DIR$ ATTRIBUTES to export the name of your choice, otherwise it must be the name of the procedure plus you may need decorations depending on the calling conventions in effect (e.g., STDCALL).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The way you did it is correct.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page