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
#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, \