1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-04 08:40:21 +02:00

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.
This commit is contained in:
Andy Wingo 2012-01-08 16:37:22 +01:00
parent 20c360b298
commit fb2be758b7

View file

@ -144,6 +144,19 @@ SCM_DEFINE (scm_display_error, "display-error", 6, 0, 0,
{ {
SCM_VALIDATE_OUTPUT_PORT (2, port); 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); scm_i_display_error (frame, port, subr, message, args, rest);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;