[cffi-devel] Re: stdcall example (was: CFFI 0.9.0 Release)

Jack Unrue jdunrue at gmail.com
Sat Feb 25 05:54:14 UTC 2006


Please find attached two variations of the same test, which is
to invoke the EnumWindows Win32 API with a callback that
simply prints a message confirming that it was called (which
occurs once for each top-level window).

After loading either of these files, run (callback-test) to
execute the test.

stdcall-test-clisp.lisp uses the CLISP FFI. Note that
it specifies :stdc-stdcall as the calling convention. This
test executes correctly as expected.

stdcall-test-cffi.lisp is the same but written in CFFI
terms, except that stdcall is not available. This variant
will crash clisp -- although circumstances may vary, so
you probably need to execute (callback-test) in a loop
to be sure.

--
Jack Unrue
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stdcall-test-cffi.lisp
Type: application/octet-stream
Size: 464 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20060224/3deb0329/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stdcall-test-clisp.lisp
Type: application/octet-stream
Size: 534 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20060224/3deb0329/attachment-0001.obj>


More information about the cffi-devel mailing list