]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 2758. ly_module_lookup caused deprecation warnings with Guile V2.06.
authorIan Hulin <ian@hulin.org.uk>
Tue, 18 Sep 2012 00:04:57 +0000 (01:04 +0100)
committerIan Hulin <ian@hulin.org.uk>
Sat, 22 Sep 2012 17:24:40 +0000 (18:24 +0100)
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.

lily/module-scheme.cc

index d18e507dcdda6f95504defe09ba2737c63f3ea8b..0da0445c9cd49ae514780795b10d718288d9e386 100644 (file)
@@ -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