[cffi-devel] (no subject)

Luís Oliveira luismbo at gmail.com
Wed Dec 23 06:03:31 UTC 2009


On Wed, Dec 23, 2009 at 1:11 AM, Luke J Crook <luke at balooga.com> wrote:
> lispbuilder-sdl and lispbuilder-sdl-ttf conditionally load different CFFI forms
> depending on the availability of a particular library.
[...]
> Is there a mechanism in CFFI to enable this if define-foreign-library cannot be
> used?

If you really want it to signal an error, you could add a clause such
as (t (:or)). E.g.:

    (define-foreign-library sdl-glue
      (:windows "lispbuilder-sdl-glue.dll")
      (t (:or)))

In this case, I suppose you could also do something like:

    (defparameter *glue-loaded-p* #+windows t #-windows nil)

Or, perhaps even better:

    (defparameter *glue-loaded-p* (foreign-library-loaded-p 'sdl-glue))

-- 
Luís Oliveira
http://r42.eu/~luis/




More information about the cffi-devel mailing list