X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/c1854b121578932e01ae210bdfa534bb3f729c3f..a60bd055f636fff2af1e58145b6dacea92115400:/glib/gforeign.lisp diff --git a/glib/gforeign.lisp b/glib/gforeign.lisp index 6ccd0a2..d883e7a 100644 --- a/glib/gforeign.lisp +++ b/glib/gforeign.lisp @@ -15,7 +15,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -;; $Id: gforeign.lisp,v 1.7 2001/04/30 11:25:25 espen Exp $ +;; $Id: gforeign.lisp,v 1.10 2001/05/31 21:52:15 espen Exp $ (in-package "GLIB") @@ -54,6 +54,8 @@ (defun find-applicable-type-method (type-spec fname &optional (error t)) (flet ((find-superclass-method (class) (when class + (unless (class-finalized-p class) + (finalize-inheritance class)) (dolist (super (cdr (pcl::class-precedence-list class))) (return-if (find-type-method super fname))))) (find-expanded-type-method (type-spec) @@ -287,10 +289,11 @@ (defmacro defbinding (name lambda-list return-type-spec &rest docs/args) - (multiple-value-bind (c-name lisp-name) + (multiple-value-bind (lisp-name c-name) (if (atom name) - (values (default-alien-fname name) name) - (values-list name)) + (values name (default-alien-fname name)) + (values-list name)) + (let ((supplied-lambda-list lambda-list) (docs nil) (args nil)) @@ -312,11 +315,6 @@ c-name lisp-name (or supplied-lambda-list (nreverse lambda-list)) return-type-spec (reverse docs) (reverse args))))) -;; For backward compatibility -(defmacro define-foreign (&rest args) - `(defbinding ,@args)) - - #+cmu (defun %defbinding (foreign-name lisp-name lambda-list return-type-spec docs args) @@ -325,7 +323,7 @@ (dolist (arg args) (destructuring-bind (var expr type-spec style) arg (let ((declaration (translate-type-spec type-spec)) - (deallocation (cleanup-alien type-spec expr t))) + (deallocation (cleanup-alien type-spec var t))) (cond ((member style '(:out :in-out)) (alien-types `(* ,declaration)) @@ -401,7 +399,6 @@ (deftype boolean (&optional (size '*)) (declare (ignore size)) `(member t nil)) -(deftype static (type) type) (deftype invalid () nil) (defun atomic-type-p (type-spec) @@ -621,7 +618,6 @@ )))) (deftype-method cleanup-alien string (type-spec c-string &optional weak-ref) - (declare (ignore type-spec)) (when weak-ref (unreference-alien type-spec c-string)))