1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

template/prelude.c.tmpl: allow UTF-8 characters

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2019-04-19 10:45:16 +00:00
parent f1a3377549
commit 4cfc6cedc4

View file

@ -45,6 +45,7 @@ class Prelude
lines = []
result = [@preludes.size, @vpath.strip(filename), lines, sub]
@vpath.foreach(filename) do |line|
line.force_encoding("ASCII-8BIT") if line.respond_to?(:force_encoding)
@preludes[filename] ||= result
comment = ($1 || '' if line.sub!(/(?:^|\s+)\#(?:$|[#\s](.*))/, ''))
if line.size > LINE_LIMIT
@ -137,7 +138,7 @@ prelude_prefix_path(VALUE self)
% unless preludes.empty?
#define PRELUDE_NAME(n) rb_usascii_str_new_static(prelude_name##n, sizeof(prelude_name##n)-1)
#define PRELUDE_CODE(n) rb_usascii_str_new_static(prelude_code##n.L0, sizeof(prelude_code##n))
#define PRELUDE_CODE(n) rb_utf8_str_new_static(prelude_code##n.L0, sizeof(prelude_code##n))
COMPILER_WARNING_PUSH
#if GCC_VERSION_SINCE(4, 2, 0)
COMPILER_WARNING_ERROR(-Wmissing-field-initializers)