From: Matt Birkholz Date: Thu, 11 Aug 2011 00:10:41 +0000 (-0700) Subject: Warn, not die, if a callback is undefined. X-Git-Tag: mit-scheme-pucked-9.2.12~650 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=9ff270fdfa059245f39b3d9a29a28ccb68d8200d;p=mit-scheme.git Warn, not die, if a callback is undefined. --- diff --git a/src/ffi/syntax.scm b/src/ffi/syntax.scm index 1f9ad28cb..43daca4bf 100644 --- a/src/ffi/syntax.scm +++ b/src/ffi/syntax.scm @@ -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))))))))