aboutsummaryrefslogtreecommitdiffstats
path: root/tool/mk_builtin_loader.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-28 13:20:40 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-28 13:20:40 +0900
commit44a659ad976221cfec3355e036daeb4e4942db55 (patch)
treee829952ab4a33aa611a4da2e125d18bf128dcb16 /tool/mk_builtin_loader.rb
parent48fb6299c6ad4fe970c05c5e30a0f6284d771164 (diff)
downloadruby-44a659ad976221cfec3355e036daeb4e4942db55.tar.gz
Replace ALT_SEPARATOR with SEPARATOR also in output file name
To suppress warnings by Visual C. ``` ./integer.rb(5) : warning C4129: 'i' : unrecognized character escape sequence ./kernel.rb(21) : warning C4129: 'k' : unrecognized character escape sequence ```
Diffstat (limited to 'tool/mk_builtin_loader.rb')
-rw-r--r--tool/mk_builtin_loader.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/tool/mk_builtin_loader.rb b/tool/mk_builtin_loader.rb
index 9d4b6405a1..fbed9fa335 100644
--- a/tool/mk_builtin_loader.rb
+++ b/tool/mk_builtin_loader.rb
@@ -212,7 +212,11 @@ def mk_builtin_header file
f.puts 'struct rb_execution_context_struct; /* in vm_core.h */'
f.puts
lineno = 11
- line_file = file.gsub('\\', '/')
+ line_file = file
+ if File::ALT_SEPARATOR
+ line_file = line_file.tr(File::ALT_SEPARATOR, File::SEPARATOR)
+ ofile = ofile.tr(File::ALT_SEPARATOR, File::SEPARATOR)
+ end
inlines.each{|cfunc_name, (body_lineno, text, params, func_name)|
if String === cfunc_name