]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/lily-guile-macros.hh
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / include / lily-guile-macros.hh
index 3f1cabbe995e8f5847615c77e9dadf496511198d..ef0db4747900b271fe9c362d06eeefe9bdbbf020 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #ifndef LILY_GUILE_MACROS_HH
@@ -83,19 +83,21 @@ inline SCM ly_symbol2scm (char const *x) { return scm_str2symbol ((x)); }
 #define DECLARE_SCHEME_CALLBACK(NAME, ARGS)    \
   static SCM NAME ARGS;                                \
   static SCM NAME ## _proc
-
 /*
   Make TYPE::FUNC available as a Scheme function.
 */
+string mangle_cxx_identifier (string);
 #define MAKE_SCHEME_CALLBACK(TYPE, FUNC, ARGCOUNT)                     \
   SCM TYPE ::FUNC ## _proc;                                            \
   void                                                                 \
   TYPE ## _ ## FUNC ## _init_functions ()                              \
   {                                                                    \
-    TYPE ::FUNC ## _proc = scm_c_define_gsubr (#TYPE "::" #FUNC,       \
+    string id = mangle_cxx_identifier (string (#TYPE) + "::" + string (#FUNC)); \
+    TYPE ::FUNC ## _proc = scm_c_define_gsubr (id.c_str(),                     \
                                               (ARGCOUNT), 0, 0,        \
                                               (Scheme_function_unknown) TYPE::FUNC); \
-    scm_c_export (#TYPE "::" #FUNC, NULL);                             \
+    scm_c_export (id.c_str (), NULL);                                  \
   }                                                                    \
                                                                        \
   ADD_SCM_INIT_FUNC (TYPE ## _ ## FUNC ## _callback,                   \