(sb-sys:sap= (cffi:null-pointer) window))
On Tue, Nov 12, 2013 at 12:55 AM, Hugo Cienfuegos Suárez <firstname.lastname@example.org> wrote:
> Just arrived to Common Lisp and SBCL
> I've installed cl-glfw3 bindings through quicklisp '(ql:quickload "cl-glfw3")' No problems here.
> Then I've loaded it through asdf "(asdf:oos 'asdf:load-op 'cl-glfw3)" It loads ok.
> Then I've tested some code, and I get SIGSEGVs.
> (defun create-window
> ...not interesting...
> (let ((window (%glfw:create-window width height title monitor shared)))
> (if (eql (cffi:null-pointer) window)
eql doesn't seem to be enough to detect equality here:
> (eql (sb-sys:int-sap 0) (sb-sys:int-sap 0))
> (sb-sys:sap= (cffi:null-pointer) (sb-sys:int-sap 0))
So maybe try replacing the test expression with this:
#-sbcl (eql (cffi:null-pointer) window)
#+sbcl (and (sb-sys:system-area-pointer-p window)