ruby-changes:36523
From: nobu <ko1@a...>
Date: Thu, 27 Nov 2014 17:10:31 +0900 (JST)
Subject: [ruby-changes:36523] nobu:r48605 (trunk): prelude.c.tmpl: no preludes, no code.
nobu 2014-11-27 17:10:21 +0900 (Thu, 27 Nov 2014) New Revision: 48605 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48605 Log: prelude.c.tmpl: no preludes, no code. * template/prelude.c.tmpl: no code if no prelude code is given. Modified files: trunk/ChangeLog trunk/template/prelude.c.tmpl Index: ChangeLog =================================================================== --- ChangeLog (revision 48604) +++ ChangeLog (revision 48605) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Nov 27 17:10:19 2014 Nobuyoshi Nakada <nobu@r...> + + * template/prelude.c.tmpl: no code if no prelude code is given. + Thu Nov 27 13:11:00 2014 Koichi Sasada <ko1@a...> * gc.c (objspace_malloc_increase): enable lazy sweep on GC by malloc() Index: template/prelude.c.tmpl =================================================================== --- template/prelude.c.tmpl (revision 48604) +++ template/prelude.c.tmpl (revision 48605) @@ -65,6 +65,7 @@ Prelude.new(output && output[/\w+(?=_pre https://github.com/ruby/ruby/blob/trunk/template/prelude.c.tmpl#L65 sources: <%= @preludes.map {|n,*| prelude_base(n)}.join(', ') %> */ +%unless @preludes.empty? #include "ruby/ruby.h" #include "internal.h" #include "vm_core.h" @@ -80,9 +81,9 @@ static const char prelude_code<%=i%>[] = https://github.com/ruby/ruby/blob/trunk/template/prelude.c.tmpl#L81 ; % } -#define PRELUDE_COUNT <%=@have_sublib ? preludes.size : 0%> - % if @have_sublib +#define PRELUDE_COUNT <%=preludes.size%> + struct prelude_env { volatile VALUE prefix_path; #if PRELUDE_COUNT > 0 @@ -134,9 +135,11 @@ prelude_require(VALUE self, VALUE nth) https://github.com/ruby/ruby/blob/trunk/template/prelude.c.tmpl#L135 } % end +%end void Init_<%=@init_name%>(void) { +%unless @preludes.empty? % if @have_sublib struct prelude_env memo; ID name = rb_intern("TMP_RUBY_PREFIX"); @@ -166,5 +169,6 @@ Init_<%=@init_name%>(void) https://github.com/ruby/ruby/blob/trunk/template/prelude.c.tmpl#L169 puts(prelude_code<%=i%>); % } #endif +%end } <%end -%> -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/