From b0e291860d77581f0ff27d5b26f8632fc0bdbeba Mon Sep 17 00:00:00 2001 From: Devon Schudy Date: Tue, 24 Jun 2014 20:55:44 -0400 Subject: [PATCH] Don't depend on features removed in Guile 2.1. (issue 3972) * Replace scm_listify with scm_list_*. (It's been deprecated for a long time.) * Use scm_protects only when available (Guile versions <2.1). --- lily/general-scheme.cc | 5 +++++ lily/include/lily-guile.hh | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc index 19d0af73ca..95d4081f39 100644 --- a/lily/general-scheme.cc +++ b/lily/general-scheme.cc @@ -271,7 +271,12 @@ LY_DEFINE (ly_protects, "ly:protects", 0, 0, 0, (), "Return hash of protected objects.") { + //scm_protects is available only in Guile versions before 2.1. +#if SCM_MAJOR_VERSION < 2 || SCM_MAJOR_VERSION == 2 && SCM_MINOR_VERSION < 1 return scm_protects; +#else + return programming_error ("ly:protects is not supported in Guile 2.1"); +#endif } LY_DEFINE (ly_gettext, "ly:gettext", diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 63e114a3fe..d678ec848a 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -121,15 +121,15 @@ inline SCM ly_bool2scm (bool x) { return scm_from_bool (x); } inline SCM ly_append2 (SCM x1, SCM x2) { - return scm_append (scm_listify (x1, x2, SCM_UNDEFINED)); + return scm_append (scm_list_2 (x1, x2)); } inline SCM ly_append3 (SCM x1, SCM x2, SCM x3) { - return scm_append (scm_listify (x1, x2, x3, SCM_UNDEFINED)); + return scm_append (scm_list_3 (x1, x2, x3)); } inline SCM ly_append4 (SCM x1, SCM x2, SCM x3, SCM x4) { - return scm_append (scm_listify (x1, x2, x3, x4, SCM_UNDEFINED)); + return scm_append (scm_list_4 (x1, x2, x3, x4)); } /* -- 2.39.2