Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 666582
Collapse All | Expand All

(-)a/lily/guile-init.cc (+8 lines)
Lines 56-61 ly_init_ly_module () Link Here
56
  for (vsize i = scm_init_funcs_->size (); i--;)
56
  for (vsize i = scm_init_funcs_->size (); i--;)
57
    (scm_init_funcs_->at (i)) ();
57
    (scm_init_funcs_->at (i)) ();
58
58
59
#if GUILEV2
60
  // We need binary ports for any of our standard input operations,
61
  // and the precompiled API calls for those crash inexplicably if we
62
  // have not explicitly loaded the module anyway.
63
  // Cf <URL:http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20209>.
64
  (void) scm_c_resolve_module ("ice-9 binary-ports");
65
#endif
66
59
  if (is_loglevel (LOG_DEBUG))
67
  if (is_loglevel (LOG_DEBUG))
60
    {
68
    {
61
      debug_output ("[", true);
69
      debug_output ("[", true);
(-)a/lily/include/lily-imports.hh (+1 lines)
Lines 37-42 namespace Guile_user { Link Here
37
  extern Variable module_use_x;
37
  extern Variable module_use_x;
38
  extern Variable symbol_p;
38
  extern Variable symbol_p;
39
  extern Variable the_root_module;
39
  extern Variable the_root_module;
40
  extern Variable default_port_encoding;
40
}
41
}
41
42
42
namespace Display {
43
namespace Display {
(-)a/lily/lily-guile.cc (-3 / +4 lines)
Lines 126-137 ly_scm2string (SCM str) Link Here
126
{
126
{
127
  assert (scm_is_string (str));
127
  assert (scm_is_string (str));
128
  string result;
128
  string result;
129
  size_t len = scm_c_string_length (str);
129
  size_t len;
130
  char *c_string = scm_to_locale_stringn (str, &len);
130
  if (len)
131
  if (len)
131
    {
132
    {
132
      result.resize (len);
133
      result.assign (c_string, len);
133
      scm_to_locale_stringbuf (str, &result.at (0), len);
134
    }
134
    }
135
  free (c_string);
135
  return result;
136
  return result;
136
}
137
}
137
138
(-)a/lily/lily-imports.cc (+1 lines)
Lines 33-38 namespace Guile_user { Link Here
33
  Variable module_use_x ("module-use!");
33
  Variable module_use_x ("module-use!");
34
  Variable symbol_p ("symbol?");
34
  Variable symbol_p ("symbol?");
35
  Variable the_root_module ("the-root-module");
35
  Variable the_root_module ("the-root-module");
36
  Variable default_port_encoding ("%default-port-encoding");
36
}
37
}
37
38
38
namespace Display {
39
namespace Display {
(-)a/lily/paper-outputter-scheme.cc (+3 lines)
Lines 44-49 LY_DEFINE (ly_make_paper_outputter, "ly:make-paper-outputter", Link Here
44
  progress_indication ("\n");
44
  progress_indication ("\n");
45
  Paper_outputter *po = new Paper_outputter (port, f);
45
  Paper_outputter *po = new Paper_outputter (port, f);
46
46
47
  if (f == "ps")
48
    scm_set_port_encoding_x(port, ly_string2scm("ISO-8859-1"));
49
47
  po->unprotect ();
50
  po->unprotect ();
48
  return po->self_scm ();
51
  return po->self_scm ();
49
}
52
}
(-)a/lily/parse-scm.cc (+7 lines)
Lines 54-60 internal_ly_parse_scm (Parse_start *ps) Link Here
54
  if (multiple)
54
  if (multiple)
55
    (void) scm_read_char (port);
55
    (void) scm_read_char (port);
56
56
57
#if GUILEV2
58
  SCM current_encoding = scm_port_encoding (port);
59
  scm_set_port_encoding_x (port, ly_string2scm("UTF-8"));
57
  SCM form = scm_read (port);
60
  SCM form = scm_read (port);
61
  scm_set_port_encoding_x (port, current_encoding);
62
#else
63
  SCM form = scm_read (port);
64
#endif
58
  SCM to = scm_ftell (port);
65
  SCM to = scm_ftell (port);
59
66
60
  hi.set (hi.get_source_file (),
67
  hi.set (hi.get_source_file (),
(-)a/lily/source-file.cc (+15 lines)
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
(-)a/ly/init.ly (-1 / +4 lines)
Lines 7-13 Link Here
7
\version "2.19.22"
7
\version "2.19.22"
8
8
9
#(if (guile-v2)
9
#(if (guile-v2)
10
  (use-modules (ice-9 curried-definitions)))
10
  (begin
11
   (use-modules (ice-9 curried-definitions))
12
   (setlocale LC_ALL "")
13
   (setlocale LC_NUMERIC "C")))
11
14
12
#(session-initialize
15
#(session-initialize
13
  (lambda ()
16
  (lambda ()

Return to bug 666582