]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/lily-guile-macros.hh
(mangle_cxx_identifier): new
[lilypond.git] / lily / include / lily-guile-macros.hh
index 15243c0d8b0d3171cec96f596c62322a11a4e6cc..3eebaec544a9e2a97c8c6c284691e27c533be014 100644 (file)
@@ -87,15 +87,17 @@ inline SCM ly_symbol2scm (char const *x) { return scm_str2symbol ((x)); }
 /*
   Make TYPE::FUNC available as a Scheme function.
 */
+std::string mangle_cxx_identifier (std::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,       \
+    std::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,                   \