On Sat, Oct 29, 2022, 5:23 AM Konstantin Khomoutov <kos...@bswap.ru> wrote:
> Hi! > > I have a need to create a Windows i386 DLL whose exported functions have > __stdcall calling convention - this is the requirement of the piece of > software which is to load and call this DLL; we cannot change the caller, > and > have to adapt to its requirements. > > The only approach I was able to find so far is to export the Go function > under > a different name and have a separate C file with an adapter function > declared > as __stdcall, which calls the target Go function. For instance, this > approach > is detailed in [1]. > > The question: is there a more direct approach? Is it somehow possible to > tell > cgo to generate the wrapper for the exported function as using __stdcall > calling convention (as such a wrapper is generated anyway)? > > 1. https://github.com/golang/go/issues/32851#issuecomment-507017147 As far as I know that is the only way. Ian > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcU8UdFGB25g4ARZAQWG843e0fFhfDDJ2puKGAB5tfTn2Q%40mail.gmail.com.