From fb2be758b76ea0ede398ed9a7f559d96d806c50e Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sun, 8 Jan 2012 16:37:22 +0100 Subject: allow scm_display_error to use a stack as the first argument * libguile/backtrace.c (scm_display_error): Allow a deprecated use of this function to pass a stack as the first argument. Thanks to Peter Brett for pointing it out, in http://lists.gnu.org/archive/html/guile-user/2011-06/msg00000.html. --- libguile/backtrace.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libguile/backtrace.c') diff --git a/libguile/backtrace.c b/libguile/backtrace.c index db22c17e9..7dd66ad2e 100644 --- a/libguile/backtrace.c +++ b/libguile/backtrace.c @@ -144,6 +144,19 @@ SCM_DEFINE (scm_display_error, "display-error", 6, 0, 0, { SCM_VALIDATE_OUTPUT_PORT (2, port); +#if SCM_ENABLE_DEPRECATED + if (SCM_STACKP (frame)) + { + scm_c_issue_deprecation_warning + ("Passing a stack as the first argument to `scm_display_error' is " + "deprecated. Pass a frame instead."); + if (SCM_STACK_LENGTH (frame)) + frame = scm_stack_ref (frame, SCM_INUM0); + else + frame = SCM_BOOL_F; + } +#endif + scm_i_display_error (frame, port, subr, message, args, rest); return SCM_UNSPECIFIED; -- cgit v1.2.3