deprecated.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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, 2012, 2013 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. SCM
  47. scm_immutable_cell (scm_t_bits car, scm_t_bits cdr)
  48. {
  49. scm_c_issue_deprecation_warning
  50. ("scm_immutable_cell is deprecated. Use scm_cell instead.");
  51. return scm_cell (car, cdr);
  52. }
  53. SCM
  54. scm_immutable_double_cell (scm_t_bits car, scm_t_bits cbr,
  55. scm_t_bits ccr, scm_t_bits cdr)
  56. {
  57. scm_c_issue_deprecation_warning
  58. ("scm_immutable_double_cell is deprecated. Use scm_double_cell instead.");
  59. return scm_double_cell (car, cbr, ccr, cdr);
  60. }
  61. void
  62. scm_i_init_deprecated ()
  63. {
  64. #include "libguile/deprecated.x"
  65. }
  66. #endif