1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

deprecate SCM_ASRTGO

* libguile/deprecated.h: Mark scm_immutable_cell and
  scm_immutable_double_cell as being SCM_DEPRECATED, not SCM_API.
  Deprecate SCM_ASRTGO.

* libguile/deprecated.c (scm_i_deprecated_asrtgo): New support
  procedure.

* doc/ref/api-control.texi (Handling Errors): Remove ASRTGO docs.
This commit is contained in:
Andy Wingo 2012-01-08 14:27:03 +01:00
parent 729b62bd95
commit 4f5fb35194
3 changed files with 24 additions and 12 deletions

View file

@ -1,6 +1,6 @@
@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2011
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2011, 2012
@c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
@ -1712,14 +1712,6 @@ leave it unspecified which argument's type is incorrect. Again,
@code{SCM_ARGn} should be preferred over a raw zero constant.
@end deftypefn
The @code{SCM_ASRTGO} macro provides another strategy for handling
incorrect types.
@deftypefn Macro void SCM_ASRTGO (int @var{test}, label)
If @var{test} is zero, use @code{goto} to jump to the given @var{label}.
@var{label} must appear within the current function.
@end deftypefn
@node Continuation Barriers
@subsection Continuation Barriers

View file

@ -2624,6 +2624,18 @@ scm_immutable_double_cell (scm_t_bits car, scm_t_bits cbr,
return scm_double_cell (car, cbr, ccr, cdr);
}
scm_t_bits
scm_i_deprecated_asrtgo (scm_t_bits condition)
{
scm_c_issue_deprecation_warning
("SCM_ASRTGO is deprecated. Use `if (!condition) goto label;' directly.");
return condition;
}

View file

@ -5,7 +5,7 @@
#ifndef SCM_DEPRECATED_H
#define SCM_DEPRECATED_H
/* Copyright (C) 2003,2004, 2005, 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
/* Copyright (C) 2003,2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@ -796,12 +796,20 @@ SCM_DEPRECATED SCM scm_struct_create_handle (SCM obj);
/* Deprecated 26-05-2011, as the GC_STUBBORN API doesn't do anything any
more. */
SCM_API SCM scm_immutable_cell (scm_t_bits car, scm_t_bits cdr);
SCM_API SCM scm_immutable_double_cell (scm_t_bits car, scm_t_bits cbr,
SCM_DEPRECATED SCM scm_immutable_cell (scm_t_bits car, scm_t_bits cdr);
SCM_DEPRECATED SCM scm_immutable_double_cell (scm_t_bits car, scm_t_bits cbr,
scm_t_bits ccr, scm_t_bits cdr);
SCM_DEPRECATED SCM scm_i_deprecated_asrtgo (scm_t_bits condition);
/* Deprecated 08-01-2012, as it's undocumented and unused. */
#define SCM_ASRTGO(_cond, _label) \
do { if (!scm_i_deprecated_asrtgo(_cond)) goto _label; } while (0)
void scm_i_init_deprecated (void);
#endif