#f is a null pointer for glut callbacks
authorAndy Wingo <wingo@pobox.com>
Wed, 13 Feb 2013 15:06:09 +0000 (16:06 +0100)
committerAndy Wingo <wingo@pobox.com>
Wed, 13 Feb 2013 15:06:09 +0000 (16:06 +0100)
* figl/glut/types.scm (coerce-callback-pointer/ephemeral):
  (coerce-callback-pointer/sticky): Allow #f to indicate a null pointer.

figl/glut/types.scm

index 9a043f6..9d1befd 100644 (file)
@@ -83,6 +83,8 @@
 
 (define (coerce-callback-pointer/ephemeral x return-type arg-types)
   (cond
+   ((not x)
+    ffi:%null-pointer)
    ((ffi:pointer? x)
     x)
    ((procedure? x)
 
 (define (coerce-callback-pointer/sticky x return-type arg-types)
   (cond
+   ((not x)
+    ffi:%null-pointer)
    ((ffi:pointer? x)
     x)
    ((procedure? x)