Safer way to compile GObject property accessors that works with lisps other than...
authorDmitry Kalyanov <user@w32dev.(none)>
Sun, 4 Oct 2009 10:33:58 +0000 (14:33 +0400)
committerDmitry Kalyanov <user@w32dev.(none)>
Sun, 4 Oct 2009 10:33:58 +0000 (14:33 +0400)
glib/gobject.meta.lisp [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index d7cb8c7..55a48ab
                              (gobject-fn-effective-slot-definition-g-getter-fn effective-slot)
                              (and property-getter
                                   (if (stringp property-getter)
-                                      (compile nil `(lambda (object)
-                                                      (foreign-funcall ,property-getter
-                                                                       g-object object
-                                                                       ,property-type)))
+                                      (if (foreign-symbol-pointer property-getter)
+                                          (compile nil `(lambda (object)
+                                                          (foreign-funcall ,property-getter
+                                                                           g-object object
+                                                                           ,property-type)))
+                                          (progn 
+                                            (warn "Property reader function '~A' has not been found" property-getter)
+                                            (lambda (object)
+                                              (declare (ignore object))
+                                              (error "Property reader function '~A' has not been found" property-getter))))
                                       property-getter))
                              (gobject-fn-effective-slot-definition-g-setter-fn effective-slot)
                              (and property-setter
                                   (if (stringp property-setter)
-                                      (compile nil `(lambda (object new-value)
-                                                      (foreign-funcall ,property-setter
-                                                                       g-object object
-                                                                       ,property-type new-value
-                                                                       :void)))
+                                      (if (foreign-symbol-pointer property-setter)
+                                          (compile nil `(lambda (object new-value)
+                                                          (foreign-funcall ,property-setter
+                                                                           g-object object
+                                                                           ,property-type new-value
+                                                                           :void)))
+                                          (progn
+                                            (warn "Property writer function '~A' has not been found" property-setter)
+                                            (lambda (object)
+                                              (declare (ignore object))
+                                              (error "Property writer function '~A' has not been found" property-setter))))
                                       property-setter)))))))
     effective-slot))