Warn, not die, if a callback is undefined.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Thu, 11 Aug 2011 00:10:41 +0000 (17:10 -0700)
committerMatt Birkholz <matt@birkholz.chandler.az.us>
Thu, 11 Aug 2011 00:10:41 +0000 (17:10 -0700)
src/ffi/syntax.scm

index 1f9ad28cb7833ecba96a920f07716dc02612bac0..43daca4bfd558230bcbae0b1025fad31b34e8b5c 100644 (file)
@@ -454,10 +454,13 @@ USA.
        (if (string? obj)
            (let* ((c-includes (find-c-includes usage-env))
                   (callbacks (c-includes/callbacks c-includes))
-                  (name (string->symbol obj)))
-             (let ((entry (assq name callbacks)))
-               (if (pair? entry) (cdr entry)
-                   (serror form "C function not declared"))))
+                  (func-name (string->symbol obj)))
+             (let ((entry (assq func-name callbacks)))
+               (if (pair? entry)
+                   (cdr entry)
+                   (begin
+                     (warn "no declaration of C function:" func-name)
+                     func-name))))
            (let ((value-form (close-syntax obj usage-env)))
              `(REGISTER-C-CALLBACK ,value-form))))))))