Lines 41-46
using namespace std;
Link Here
|
41 |
#include "international.hh" |
41 |
#include "international.hh" |
42 |
#include "misc.hh" |
42 |
#include "misc.hh" |
43 |
#include "warn.hh" |
43 |
#include "warn.hh" |
|
|
44 |
#include "lily-imports.hh" |
44 |
|
45 |
|
45 |
void |
46 |
void |
46 |
Source_file::load_stdin () |
47 |
Source_file::load_stdin () |
Lines 151-158
Source_file::init_port ()
Link Here
|
151 |
// This is somewhat icky: the string will in general be in utf8, but |
152 |
// This is somewhat icky: the string will in general be in utf8, but |
152 |
// we do our own utf8 encoding and verification in the parser, so we |
153 |
// we do our own utf8 encoding and verification in the parser, so we |
153 |
// use the no-conversion equivalent of latin1 |
154 |
// use the no-conversion equivalent of latin1 |
|
|
155 |
#if GUILEV2 |
156 |
SCM str = scm_c_make_bytevector (length () - 1); |
157 |
memcpy (SCM_BYTEVECTOR_CONTENTS (str), c_str (), length () - 1); |
158 |
// Setting %default-port-encoding to binary before calling |
159 |
// open-bytevector-input-port appears quite unnecessary regarding |
160 |
// the documented semantics, but at least GUILE 2.0.11 is not |
161 |
// particularly interested in sticking to its documentation. |
162 |
// <URL:http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20200> |
163 |
scm_dynwind_begin ((scm_t_dynwind_flags)0); |
164 |
scm_dynwind_fluid (Guile_user::default_port_encoding, SCM_BOOL_F); |
165 |
str_port_ = scm_open_bytevector_input_port (str, SCM_UNDEFINED); |
166 |
scm_dynwind_end (); |
167 |
#else |
154 |
SCM str = scm_from_latin1_string (c_str ()); |
168 |
SCM str = scm_from_latin1_string (c_str ()); |
155 |
str_port_ = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG, __FUNCTION__); |
169 |
str_port_ = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG, __FUNCTION__); |
|
|
170 |
#endif |
156 |
scm_set_port_filename_x (str_port_, ly_string2scm (name_)); |
171 |
scm_set_port_filename_x (str_port_, ly_string2scm (name_)); |
157 |
} |
172 |
} |
158 |
|
173 |
|