> On Dec 13, 2017, at 10:28 PM, John McCall via swift-dev <swift-dev@swift.org> > wrote: > >> On Dec 13, 2017, at 8:35 PM, Saleem Abdulrasool <compn...@compnerd.org >> <mailto:compn...@compnerd.org>> wrote: >> >>> On Wed, Dec 13, 2017 at 4:14 PM, John McCall <rjmcc...@apple.com >>> <mailto:rjmcc...@apple.com>> wrote: > >>> >>> - SILGen may need to introduce thunks when passing around such functions >>> as @convention(c) function values. Code for this already exists in order >>> to allow C functions to be passed around as native function values. >> >> This sounds pretty good and would broaden the abilities for swift to FFI to >> existing code. > > Yeah. This should work well as long as there isn't an API that needs to > traffic in non-standard function *pointers*.
32-bit Windows needs to do that. Callback functions passed to the Windows API via parameters or struct fields are often __stdcall but the default calling convention is __cdecl. -- Greg Parker gpar...@apple.com Runtime Wrangler
_______________________________________________ swift-dev mailing list swift-dev@swift.org https://lists.swift.org/mailman/listinfo/swift-dev