[cffi-devel] %LOAD-FOREIGN-LIBRARY and keyword :FOREIGN

Andrew Philpot philpot at ISI.EDU
Thu Feb 2 02:29:03 UTC 2006


<in cffi-allegro.lisp>

In Allegro 6.2 (and presumably all earlier versions), the keyword
argument :FOREIGN to function LOAD is not defined.  So perhaps you
want something more like:

(defun %load-foreign-library (name)
  "Load the foreign library NAME."
  ;; ACL 8.0 honors the :FOREIGN option and always tries to foreign load
  ;; the argument. However, previous versions do not and will only
  ;; foreign load the argument if its type is a member of the
  ;; EXCL::*LOAD-FOREIGN-TYPES* list. Therefore, we bind that special
  ;; to a list containing whatever type NAME has.
  (let ((excl::*load-foreign-types*
         (list (pathname-type (parse-namestring name)))))
    (ignore-errors (load name 
                         #+(and allegro-version>= (version>= 7 0)) :foreign
                         #+(and allegro-version>= (version>= 7 0)) t))))

Andrew





More information about the cffi-devel mailing list