From 9ff270fdfa059245f39b3d9a29a28ccb68d8200d Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Wed, 10 Aug 2011 17:10:41 -0700 Subject: [PATCH] Warn, not die, if a callback is undefined. --- src/ffi/syntax.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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)))))))) -- 2.25.1