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

-- 
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/20221029122303.o4yl5g33swjectqn%40carbon.

Reply via email to