X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Flily-guile.hh;h=e67293e06f89c3c4897097722899b1e692e53f41;hb=0817e0513d1016ff22a633b6fee20ddba2a062f2;hp=54c9decd293fea8ff8ef6a33d7caabae96ff427e;hpb=dfe0c6ad15227d6d3646bd7445df5de6aa386ff7;p=lilypond.git diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 54c9decd29..e67293e06f 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -9,6 +9,8 @@ #ifndef LILY_GUILE_HH #define LILY_GUILE_HH +#define SCM_VOIDP_TEST + #include /* @@ -89,6 +91,8 @@ SCM ly_truncate_list (int k, SCM l ); #define CACHE_SYMBOLS #ifdef CACHE_SYMBOLS +SCM my_gh_symbol2scm (const char* x); + // #warning: CACHE_SYMBOLS /* @@ -102,10 +106,11 @@ SCM ly_truncate_list (int k, SCM l ); */ #define ly_symbol2scm(x) ({ static SCM cached; \ SCM value = cached; /* We store this one locally, since G++ -O2 fucks up else */ \ - if (__builtin_constant_p (x))\ - value = cached = scm_permanent_object (gh_symbol2scm((char*)x));\ - else\ - value = gh_symbol2scm ((char*)x); \ + if ( __builtin_constant_p ((x)))\ + { if (!cached)\ + value = cached = scm_gc_protect_object (my_gh_symbol2scm((char*) (x)));\ + } else\ + value = gh_symbol2scm ((char*) (x)); \ value; }) #else inline SCM ly_symbol2scm(char const* x) { return gh_symbol2scm((char*)x); }