X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Flily-guile-macros.hh;h=555d65bfd3a6aa116923ec46456796184f582f37;hb=f9214bac21e9926dc3248416f58190c98c4167a9;hp=77c45973648e33f0888c3be00c2c62bc4298f2e1;hpb=ce83e6caa171094d868362fb670ca2193202de8b;p=lilypond.git diff --git a/lily/include/lily-guile-macros.hh b/lily/include/lily-guile-macros.hh index 77c4597364..555d65bfd3 100644 --- a/lily/include/lily-guile-macros.hh +++ b/lily/include/lily-guile-macros.hh @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 2005--2006 Han-Wen Nienhuys + (c) 2005--2007 Han-Wen Nienhuys */ #ifndef LILY_GUILE_MACROS_HH @@ -21,11 +21,12 @@ #define SCM_UNPACK(x) (x) #endif -#if (__GNUC__ > 2) /* Unreliable with gcc-2.x FIXME: should add check for x86 as well? */ #define CACHE_SYMBOLS -#endif + + + #ifdef CACHE_SYMBOLS @@ -35,14 +36,16 @@ inline SCM scm_or_str2symbol (char const *c) { return scm_str2symbol (c); } inline SCM -scm_or_str2symbol (SCM s) { return s; } +scm_or_str2symbol (SCM s) { + assert (scm_is_symbol (s)); + return s; +} /* Using this trick we cache the value of scm_str2symbol ("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. - - The overall speedup of lily is about 5% on a run of wtk1-fugue2. */ + */ #define ly_symbol2scm(x) \ ({ \ static SCM cached; \ @@ -160,12 +163,17 @@ ly_add_function_documentation (SCM proc, char const *fname, VAR, ARGLIST, DOCSTRING) #define get_property(x) internal_get_property (ly_symbol2scm (x)) +#define get_property_data(x) internal_get_property_data (ly_symbol2scm (x)) #define get_object(x) internal_get_object (ly_symbol2scm (x)) #define set_object(x, y) internal_set_object (ly_symbol2scm (x), y) #define del_property(x) internal_del_property (ly_symbol2scm (x)) #ifndef NDEBUG -#define set_property(x, y) internal_set_property (ly_symbol2scm (x), y, __FILE__, __LINE__, __FUNCTION__) +/* + TODO: include modification callback support here, perhaps + through intermediate Grob::instrumented_set_property( .. __LINE__ ). + */ +#define set_property(x, y) internal_set_property (ly_symbol2scm (x), y) #else #define set_property(x, y) internal_set_property (ly_symbol2scm (x), y) #endif