[cffi-devel] pathnames and libraries

JTK jetmonk at gmail.com
Tue Feb 14 20:20:30 UTC 2012



When trying to install GSLL (the gnu scientific library lisp package) using quicklisp,
I noticed that it failed because the library name was a pathname rather than a string.

I fixed it by changing cffi's src/libraries.lisp as described below, putting pathnames into
the etypecase.

Is there some reason why this isn't done normally?

John







;; from src/libraries.lisp
(defun load-foreign-library-helper (name thing &optional search-path)
  (etypecase thing
    (string
     (load-foreign-library-path name thing search-path))
    (pathname ;; #### MAKE IT HANDLE PATHNAMES
     (load-foreign-library-path name (namestring thing) search-path)) ;; JTK
    (cons
     (ecase (first thing)
       (:framework (load-darwin-framework name (second thing)))
       (:default
        (unless (stringp (second thing))  
          (fl-error "Argument to :DEFAULT must be a string."))
        (let ((library-path
               (concatenate 'string
                            (second thing)
                            (default-library-suffix))))
          (load-foreign-library-path name library-path search-path)))
       (:or (try-foreign-library-alternatives name (rest thing)))))))



More information about the cffi-devel mailing list