On Aug 24, 7:22 am, brainman <
alex.brain...@gmail.com> wrote:
>
> > But some DLL have CDECL exports and callbacks, LIBTIFF to name one.
>
> Never have used one. Please give more details.
That calling convention is called __cdecl in contrary with __stdcall
when callee takes care on cleaning stack.
__cdecl is default and only calling convention on windows/amd64
__stdcall is default but not only calling convention on windows/386
In some cases __cdecl is used on windows/386:
1. legacy libraries (libtiff to name one) use __cdecl for all their
functions on all their platforms
2. functions with ellipsis expect the caller to clean up the stack, so
they cannot technically follow __stdcall convention
USER32.wsprintf() is one but useless example of a function which
cannot be called from Go on windows/386
more useful example: ShellMessageBox()
http://msdn.microsoft.com/en-us/library/bb762155(v=vs.85).aspx