From: Dmitry Kalyanov Date: Wed, 5 Aug 2009 17:59:22 +0000 (+0400) Subject: GObject: correctly specify :count options for slots of generated cstruct X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=5e599952035393d676c81b336f2d1589ffe13b5d;p=cl-gtk2.git GObject: correctly specify :count options for slots of generated cstruct --- diff --git a/glib/gobject.boxed.lisp b/glib/gobject.boxed.lisp index 8605a4e..0c7f8be 100644 --- a/glib/gobject.boxed.lisp +++ b/glib/gobject.boxed.lisp @@ -58,11 +58,11 @@ (defmacro define-g-boxed-cstruct (name g-type-name &body slots) `(progn (defstruct ,name - ,@(iter (for (name type &key initarg) in slots) + ,@(iter (for (name type &key count initarg) in slots) (collect (list name initarg)))) (defcstruct ,(generated-cstruct-name name) - ,@(iter (for (name type &key initarg) in slots) - (collect `(,name ,type)))) + ,@(iter (for (name type &key count initarg) in slots) + (collect `(,name ,type ,@(when count `(:count ,count)))))) (eval-when (:compile-toplevel :load-toplevel :execute) (setf (get ',name 'g-boxed-foreign-info) (make-g-boxed-cstruct-wrapper-info :name ',name @@ -273,7 +273,7 @@ ,@(iter (for slot in (var-struct-all-slots struct)) (collect `(,(var-structure-slot-name slot) ,(var-structure-slot-type slot) ,@(when (var-structure-slot-count slot) - (list `(:count ,(var-structure-slot-count slot))))))))) + `(:count ,(var-structure-slot-count slot)))))))) (defun generate-c-structures (structure) (iter (for str in (all-structures structure))