X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fgeneral-scheme.cc;h=2ab34a086f58dffe1d098c1addfb388ab2237528;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=af2bcd73b4337e06689c74615a2310b0cf60996f;hpb=8b512c90dd5cb138e5043c069dc3b5f372f68e7d;p=lilypond.git diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc index af2bcd73b4..2ab34a086f 100644 --- a/lily/general-scheme.cc +++ b/lily/general-scheme.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1998--2011 Jan Nieuwenhuizen + Copyright (C) 1998--2015 Jan Nieuwenhuizen Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify @@ -99,7 +99,6 @@ LY_DEFINE (ly_gulp_file, "ly:gulp-file", return scm_from_locale_stringn (contents.c_str (), contents.length ()); } - LY_DEFINE (ly_dir_p, "ly:dir?", 1, 0, 0, (SCM s), "Is @var{s} a direction? Valid directions are @w{@code{-1}}," @@ -107,7 +106,7 @@ LY_DEFINE (ly_dir_p, "ly:dir?", " left or down, @code{1}@tie{}represents right or up, and @code{0}" " represents a neutral direction.") { - if (scm_is_number (s)) + if (scm_is_integer (s)) { int i = scm_to_int (s); return (i >= -1 && i <= 1) ? SCM_BOOL_T : SCM_BOOL_F; @@ -229,8 +228,8 @@ LY_DEFINE (ly_number_2_string, "ly:number->string", Real r (scm_to_double (s)); if (isinf (r) || isnan (r)) { - programming_error (_ ("infinity or NaN encountered while converting Real number")); - programming_error (_ ("setting to zero")); + programming_error ("infinity or NaN encountered while converting Real number, " + "setting to zero"); r = 0.0; } @@ -272,7 +271,12 @@ LY_DEFINE (ly_protects, "ly:protects", 0, 0, 0, (), "Return hash of protected objects.") { + //scm_protects is available only in Guile versions before 2.1. +#if SCM_MAJOR_VERSION < 2 || SCM_MAJOR_VERSION == 2 && SCM_MINOR_VERSION < 1 return scm_protects; +#else + return programming_error ("ly:protects is not supported in Guile 2.1"); +#endif } LY_DEFINE (ly_gettext, "ly:gettext", @@ -467,7 +471,7 @@ format_single_argument (SCM arg, int precision, bool escape = false) if (isnan (val) || isinf (val)) { - warning (_ ("Found infinity or nan in output. Substituting 0.0")); + warning (_ ("Found infinity or nan in output. Substituting 0.0")); return ("0.0"); if (strict_infinity_checking) abort ();