[cffi-devel] uffi-compat bitrot (and patch)
Robert J. Macomber
xbxyh8 at rojoma.com
Sun Jan 8 20:59:07 UTC 2006
With the new type translator system, uffi-compat broke a little. I've
written a patch for it, though I'm not 100% sure it's correct.
However, with the patch, it passes all uffi's tests, and cl-gd seems
to work properly. The patch is attached.
--
Robert Macomber / Thas on #lisp
xbxyh8 at rojoma.com
-------------- next part --------------
diff -rN old-cffi/uffi-compat/uffi-compat.lisp new-cffi/uffi-compat/uffi-compat.lisp
154,155c154,155
< (cffi:define-type-translator uffi-char :to-c (value)
< `(char-code ,value))
---
> (defmethod cffi:translate-to-foreign ((value character) (name (eql 'uffi-char)))
> (char-code value))
157,158c157,158
< (cffi:define-type-translator uffi-char :from-c (value)
< `(code-char ,value))
---
> (defmethod cffi:translate-from-foreign (obj (name (eql 'uffi-char)))
> (code-char obj))
290c290
< (cffi::translate-from-c (cffi:mem-ref ptr type) (cffi::parse-type type)))
---
> (cffi::translate-type-from-foreign (cffi:mem-ref ptr type) (cffi::parse-type type)))
294c294
< (cffi::translate-to-c value (cffi::parse-type type))))
---
> (cffi::translate-type-to-foreign value (cffi::parse-type type))))
More information about the cffi-devel
mailing list