From: Ian Hulin Date: Tue, 18 Sep 2012 00:04:57 +0000 (+0100) Subject: Issue 2758. ly_module_lookup caused deprecation warnings with Guile V2.06. X-Git-Tag: release/2.17.3-1^2~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c6be25d150f80e17d1f78aa7b90e1ff0d561fbeb;p=lilypond.git Issue 2758. ly_module_lookup caused deprecation warnings with Guile V2.06. The V2.17.0 definition of ly_module_lookup in module-scheme.cc uses two functions, scm_sym2var and scm_module_lookup_closure, which issue deprecation warnings in Guile V2.06. A call to the new Guile API function, scm_module_variable, provides the functionality for both deprecated routines, but has not been back-ported to Guile V1.8. This patch adds a conditionally-compiled block when running with a Guile version < V2.0, so that Guile V1 will the existing undocumented API calls in ly_module_lookup, but Guile V2 will use API call scm_module_variable. --- diff --git a/lily/module-scheme.cc b/lily/module-scheme.cc index d18e507dcd..0da0445c9c 100644 --- a/lily/module-scheme.cc +++ b/lily/module-scheme.cc @@ -67,13 +67,12 @@ ly_module_lookup (SCM module, SCM sym) /* Issue 2758: Guile V2 onward has a scm_module_variable API module. - Guile V1.8.7 only has a (module-variable) REPL function. - Replace previous code using undocumented API calls deprecated - in Guile V2. + Guile V1.8.7 only has a (module-variable) REPL function, however + using ly_lily_module_constant ("module-variable") and calling + the memoized result is slow. */ #if GUILEV1 - static SCM module_variable_func = ly_lily_module_constant ("module-variable"); - return scm_call_2 (module_variable_func, module, sym); + return scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F); #else return scm_module_variable (module, sym); #endif