#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"
int n;
char *str = gulp_file (s, &n);
- String result (str);
+ String result ((Byte*) str, n);
delete[] str;
if (verbose_global_b)
"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 ());
}
if (scm_is_number (s))
{
int i = scm_to_int (s);
- return i== 0 || i == 1;
+ return i == 0 || i == 1;
}
return false;
}
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;
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);