andy128k / cl-gobject-introspection

BSD 2-Clause "Simplified" License
49 stars 15 forks source link

GI-FFI > FFI and DEFCTYPE for G-SLIST #4

Closed Ferada closed 10 years ago

Ferada commented 10 years ago

Two small patches attached, one rename in the documentation and the other to prevent CFFI compilation warnings.

And I tried the example, which was great to see, but only the commented out call to G-SIGNAL-CONNECT-DATA worked for me (that is, HELLO was called), not the second one with CONNECT.

Kalimehtar commented 10 years ago

Thank you for commits. It is strange, that example with "connect" doesn't work... I tested it. Can you describe your lisp system, OS, CPU and if something written to console after starting the example, then it?

Ferada commented 10 years ago

Yeah, it can very well be that my system isn't updated very well ...

System is Linux 2.6.36-gentoo-r5 x86_64, sbcl is 1.0.55.15.master.6-1720996.

So I loaded asdf (3.0.2.7) and cl-object-introspection and then ran gir-test::main, which resulted in:

(sbcl:2534): GLib-GObject-CRITICAL **: g_closure_new_simple: assertion `sizeof_closure >= sizeof (GClosure)' failed
(sbcl:2534): GLib-GObject-CRITICAL **: g_closure_set_marshal: assertion `closure != NULL' failed
(sbcl:2534): GLib-GObject-CRITICAL **: g_closure_add_finalize_notifier: assertion `closure != NULL' failed
(sbcl:2534): GLib-GObject-CRITICAL **: g_signal_connect_closure: assertion `closure != NULL' failed

dev-libs/gobject-introspection-1.32.1 dev-libs/gobject-introspection-common-1.32.1

x11-libs/gtk+-3.4.4 (and x11-libs/gtk+-2.24.13) dev-libs/glib-2.32.4

Kalimehtar commented 10 years ago

Maybe it is because of x64. My system is x32 Please, try change in signal.lisp in defun make-closure (g-closure-new-simple 16 ...) to (g-closure-new-simple 32 ...)

If it will be ok, I'll try to change 16 to something system-dependent (like size of array of 4 pointers)

Ferada commented 10 years ago

Yes, that did it! Maybe the size could be extracted via CFFI-Grovel?