]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-guile.cc
* lily/dots.cc (print): replace -
[lilypond.git] / lily / lily-guile.cc
index d7c8c39cb3ac9cd297665e990c771bab1bfe098d..f418df157d8e5076bb00fea350911a21fb932bc4 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <cstdio>
 #include <cstdlib>
-#include <cmath>   /* isinf */
+#include <math.h>   /* isinf */
 #include <cstring> /* strdup, strchr */
 #include <cctype>
 
 
 /* MacOS S fix:
    source-file.hh includes cmath which undefines isinf and isnan
-
-   FIXME: #ifdef MACOS_X?
 */
+#ifdef __APPLE__
 inline int my_isinf (Real r) { return isinf (r); }
 inline int my_isnan (Real r) { return isnan (r); }
+#endif
 
 #include "libc-extension.hh"
 #include "main.hh"
@@ -111,7 +111,7 @@ gulp_file_to_string (String fn, bool must_exist)
 
   int n;
   char *str = gulp_file (s, &n);
-  String result (str);
+  String result ((Byte*) str, n);
   delete[] str;
   
   if (verbose_global_b)
@@ -126,9 +126,8 @@ LY_DEFINE (ly_gulp_file, "ly:gulp-file",
           "The file is looked up using the search path.")
 {
   SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string");
-  return scm_makfrom0str (gulp_file_to_string (ly_scm2string (name),
-                                              true).to_str0 ());
-                                              
+  String contents = gulp_file_to_string (ly_scm2string (name), true);
+  return scm_from_locale_stringn (contents.get_str0 (), contents.length ());
 }
 
 
@@ -306,7 +305,7 @@ is_axis (SCM s)
   if (scm_is_number (s))
     {
       int i = scm_to_int (s);
-      return i== 0 || i == 1;
+      return i == 0 || i == 1;
     }
   return false;
 }
@@ -386,8 +385,11 @@ LY_DEFINE (ly_number2string, "ly:number->string",
   if (scm_exact_p (s) == SCM_BOOL_F)
     {
       Real r (scm_to_double (s));
-
+#ifdef __APPLE__
       if (my_isinf (r) || my_isnan (r))
+#else
+      if (isinf (r) || isnan (r))
+#endif
        {
          programming_error ("Infinity or NaN encountered while converting Real number; setting to zero.");
          r = 0.0;
@@ -729,7 +731,7 @@ display_list (SCM s)
   SCM p = scm_current_output_port ();
 
   scm_puts ("(", p);
-  for (; scm_is_pair (s); s =scm_cdr (s))
+  for (; scm_is_pair (s); s = scm_cdr (s))
     {
       scm_display (scm_car (s), p);
       scm_puts (" ", p);