[squeak-dev] [Q] FFI for Windows; PASCAL(WINAPI) or C Calling convention?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] [Q] FFI for Windows; PASCAL(WINAPI) or C Calling convention?

Chun, Sungjin
Hi,

I'd like to create a DLL for windows platform(Tokyo Dystopia based search tool). Now
I found that there's 2 kind of calling convention in Windows. What convention
should I follow to create DLL so that it could be called from Squeak using FFI?

Thanks in advance.

PS) I'm using old plain FFI, not Alien thing. :-)

Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: [Q] FFI for Windows; PASCAL(WINAPI) or C Calling convention?

Andreas.Raab
S.J.Chun wrote:
> I'd like to create a DLL for windows platform(Tokyo Dystopia based search tool). Now
> I found that there's 2 kind of calling convention in Windows. What convention
> should I follow to create DLL so that it could be called from Squeak using FFI?

If your DLL is Windows-only, use __stdcall (i.e., WINAPI). If you need
to port it to other platforms use __cdecl. Both can be called.

Cheers,
   - Andreas