From f931463b3d2aebd57e29b243d971c27b4de232cf Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Thu, 18 Aug 2011 11:34:55 -0700 Subject: [PATCH] Warn, not die, when a callback or constant is undefined. --- src/ffi/syntax.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ffi/syntax.scm b/src/ffi/syntax.scm index 1f9ad28cb..765dd2da2 100644 --- a/src/ffi/syntax.scm +++ b/src/ffi/syntax.scm @@ -238,7 +238,9 @@ USA. (define (lookup-enum-value name whole-form includes) (let ((entry (assq name (c-includes/enum-values includes)))) (if (not entry) - (serror whole-form "constant not declared") + (begin + (warn "no declaration of constant:" name) + 0) (cdr entry)))) (define (c-enum-constant-values name form includes) @@ -425,7 +427,7 @@ USA. (if (pair? entry) (cdr entry) (begin - (warn "no declaration of C function:" func-name) + (warn "no declaration of callout:" func-name) func-name))))) `(CALL-ALIEN ,alien . ,(map (lambda (form) (close-syntax form usage-env)) @@ -457,7 +459,9 @@ USA. (name (string->symbol obj))) (let ((entry (assq name callbacks))) (if (pair? entry) (cdr entry) - (serror form "C function not declared")))) + (begin + (warn "no declaration of callback:" name) + name)))) (let ((value-form (close-syntax obj usage-env))) `(REGISTER-C-CALLBACK ,value-form)))))))) -- 2.25.1