deprecated.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* This file contains definitions for deprecated features. When you
  2. deprecate something, move it here when that is feasible.
  3. */
  4. /* Copyright (C) 2003, 2004, 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public License
  8. * as published by the Free Software Foundation; either version 3 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19. * 02110-1301 USA
  20. */
  21. #ifdef HAVE_CONFIG_H
  22. # include <config.h>
  23. #endif
  24. #define SCM_BUILDING_DEPRECATED_CODE
  25. #include "libguile/_scm.h"
  26. #include "libguile/deprecation.h"
  27. #if (SCM_ENABLE_DEPRECATED == 1)
  28. SCM
  29. scm_internal_dynamic_wind (scm_t_guard before,
  30. scm_t_inner inner,
  31. scm_t_guard after,
  32. void *inner_data,
  33. void *guard_data)
  34. {
  35. SCM ans;
  36. scm_c_issue_deprecation_warning
  37. ("`scm_internal_dynamic_wind' is deprecated. "
  38. "Use the `scm_dynwind_begin' / `scm_dynwind_end' API instead.");
  39. scm_dynwind_begin (SCM_F_DYNWIND_REWINDABLE);
  40. scm_dynwind_rewind_handler (before, guard_data, SCM_F_WIND_EXPLICITLY);
  41. scm_dynwind_unwind_handler (after, guard_data, SCM_F_WIND_EXPLICITLY);
  42. ans = inner (inner_data);
  43. scm_dynwind_end ();
  44. return ans;
  45. }
  46. void
  47. scm_i_init_deprecated ()
  48. {
  49. #include "libguile/deprecated.x"
  50. }
  51. #endif