/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 2005--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 2005--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#ifndef LILY_GUILE_MACROS_HH
#define LILY_GUILE_MACROS_HH
+#include "config.hh"
+
#ifndef SMOB_FREE_RETURN_VAL
#define SMOB_FREE_RETURN_VAL(CL) 0
#endif
#define SCM_UNPACK(x) (x)
#endif
+/* For backward compatability with Guile 1.8 */
+#if !HAVE_GUILE_SUBR_TYPE
+typedef SCM (*scm_t_subr) (GUILE_ELLIPSIS);
+#endif
+
/* Unreliable with gcc-2.x
FIXME: should add check for x86 as well? */
#define CACHE_SYMBOLS
/* this lets us "overload" macros such as get_property to take
symbols as well as strings */
inline SCM
-scm_or_str2symbol (char const *c) { return scm_str2symbol (c); }
+scm_or_str2symbol (char const *c) { return scm_from_locale_symbol (c); }
inline SCM
scm_or_str2symbol (SCM s) {
return s;
}
-/* Using this trick we cache the value of scm_str2symbol ("fooo") where
+/* Using this trick we cache the value of scm_from_locale_symbol ("fooo") where
"fooo" is a constant string. This is done at the cost of one static
variable per ly_symbol2scm() use, and one boolean evaluation for
every call.
value; \
})
#else
-inline SCM ly_symbol2scm (char const *x) { return scm_str2symbol ((x)); }
+inline SCM ly_symbol2scm (char const *x) { return scm_from_locale_symbol ((x)); }
#endif
/*
if (__builtin_constant_p ((x))) \
{ \
if (!cached) \
- value = cached = scm_eval (scm_str2symbol (x), \
- global_lily_module); \
+ value = cached = scm_eval (scm_from_locale_symbol (x), \
+ global_lily_module); \
} \
else \
- value = scm_eval (scm_str2symbol (x), global_lily_module); \
+ value = scm_eval (scm_from_locale_symbol (x), global_lily_module); \
value; \
})
string id = mangle_cxx_identifier (cxx); \
TYPE ::FUNC ## _proc = scm_c_define_gsubr (id.c_str(), \
(ARGCOUNT-OPTIONAL_COUNT), OPTIONAL_COUNT, 0, \
- (Scheme_function_unknown) TYPE::FUNC); \
+ (scm_t_subr) TYPE::FUNC); \
ly_add_function_documentation (TYPE :: FUNC ## _proc, id.c_str(), "", \
DOC); \
scm_c_export (id.c_str (), NULL); \
INITPREFIX ## init () \
{ \
FNAME ## _proc = scm_c_define_gsubr (PRIMNAME, REQ, OPT, VAR, \
- (Scheme_function_unknown) FNAME); \
+ (scm_t_subr) FNAME); \
ly_check_name (#FNAME, PRIMNAME);\
ly_add_function_documentation (FNAME ## _proc, PRIMNAME, #ARGLIST, \
DOCSTRING); \