Skip to content

Commit

Permalink
Fix handling of the T clause in DEFINE-FOREIGN-LIBRARY
Browse files Browse the repository at this point in the history
- Added regression test: LIBRARY.T-CLAUSE.

Bug report and initial patch courtesy of Kalyanov Dmitry.
  • Loading branch information
luismbo committed Sep 12, 2008
1 parent 694781b commit d823907
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libraries.lisp
Expand Up @@ -117,7 +117,10 @@
(setf (gethash name *foreign-libraries*) value))

(defun %foreign-library-spec (lib)
(assoc-if #'featurep (slot-value lib 'spec)))
(assoc-if (lambda (feature)
(or (eq feature t)
(featurep feature)))
(slot-value lib 'spec)))

(defun foreign-library-spec (lib)
(second (%foreign-library-spec lib)))
Expand Down
13 changes: 13 additions & 0 deletions tests/misc.lisp
Expand Up @@ -83,6 +83,19 @@
(load-foreign-library-error () 'error))
error)

(define-foreign-library pseudo-library
(t pseudo-library-spec))

;;; RT: T clause was being handled as :T by FEATUREP.
;;;
;;; We might want to export (and clean up) the API used in this test
;;; when the need arises.
(deftest library.t-clause
(eq (cffi::foreign-library-spec
(cffi::get-foreign-library 'pseudo-library))
'pseudo-library-spec)
t)

;;;# Shareable Byte Vector Tests

#+(or ecl allegro)
Expand Down

0 comments on commit d823907

Please sign in to comment.