X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fsource-file.cc;h=fc5b03483d78cc85582d04bf7ad576c9bb681a64;hb=a844a021bff59d54af54d40366cf5d9bb235b12b;hp=4415e8dad70978c15fef06b31c2f6cd6791f7a2b;hpb=8f5cd22af76fcb5c77853a5ede8b94ebef97caef;p=lilypond.git diff --git a/lily/source-file.cc b/lily/source-file.cc index 4415e8dad7..fc5b03483d 100644 --- a/lily/source-file.cc +++ b/lily/source-file.cc @@ -3,19 +3,24 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2006 Jan Nieuwenhuizen + (c) 1997--2009 Jan Nieuwenhuizen Han-Wen Nienhuys */ +#if GCC_MAJOR < 4 +#define _GLIBCXX_HAVE_MBSTATE_T +#include +#endif /* GCC_MAJOR < 4 */ + #include "source-file.hh" #include "config.hh" #if HAVE_UTF8_WCHAR_H #include /* mbrtowc */ -#else +#else /* !HAVE_UTF8_WCHAR_H */ #include /* mbrtowc */ -#endif +#endif /* HAVE_UTF8_WCHAR_H */ #include @@ -138,9 +143,9 @@ Source_file::Source_file (string filename_string) void Source_file::init_port () { - SCM str = scm_makfrom0str (c_str ()); + SCM str = scm_from_locale_string (c_str ()); str_port_ = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG, __FUNCTION__); - scm_set_port_filename_x (str_port_, scm_makfrom0str (name_.c_str ())); + scm_set_port_filename_x (str_port_, ly_string2scm (name_)); } @@ -188,7 +193,7 @@ Source_file::quote_input (char const *pos_str0) const string context = line.substr (0, ch) + to_string ('\n') + to_string (' ', col) - + line.substr (ch, line.length()-ch); + + line.substr (ch, line.length ()-ch); return context; } @@ -365,9 +370,9 @@ Source_file::get_port () const #include "ly-smobs.icc" -IMPLEMENT_SMOBS(Source_file); -IMPLEMENT_DEFAULT_EQUAL_P(Source_file); -IMPLEMENT_TYPE_P(Source_file, "ly:source-file?"); +IMPLEMENT_SMOBS (Source_file); +IMPLEMENT_DEFAULT_EQUAL_P (Source_file); +IMPLEMENT_TYPE_P (Source_file, "ly:source-file?"); SCM Source_file::mark_smob (SCM smob)