ruby-changes:37810
From: nobu <ko1@a...>
Date: Sun, 8 Mar 2015 15:30:52 +0900 (JST)
Subject: [ruby-changes:37810] nobu:r49891 (trunk): miniinit.c: minimum built-in encodings in miniruby
nobu 2015-03-08 15:30:32 +0900 (Sun, 08 Mar 2015) New Revision: 49891 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49891 Log: miniinit.c: minimum built-in encodings in miniruby * common.mk (MINIOBJS): no longer need dmyenc.o. * miniinit.c (Init_enc): declare minimum built-in encodings so that these Encoding constants will be available in miniruby. Modified files: trunk/Makefile.in trunk/common.mk trunk/miniinit.c trunk/win32/Makefile.sub Index: miniinit.c =================================================================== --- miniinit.c (revision 49890) +++ miniinit.c (revision 49891) @@ -28,3 +28,12 @@ Init_enc_set_filesystem_encoding(void) https://github.com/ruby/ruby/blob/trunk/miniinit.c#L28 { return rb_enc_to_index(rb_default_external_encoding()); } + +void +Init_enc(void) +{ + void rb_encdb_declare(const char *name); + rb_encdb_declare("ASCII-8BIT"); + rb_encdb_declare("US-ASCII"); + rb_encdb_declare("UTF-8"); +} Index: common.mk =================================================================== --- common.mk (revision 49890) +++ common.mk (revision 49891) @@ -39,7 +39,7 @@ NORMALMAINOBJ = main.$(OBJEXT) https://github.com/ruby/ruby/blob/trunk/common.mk#L39 MAINOBJ = $(NORMALMAINOBJ) DLDOBJS = $(INITOBJS) EXTSOLIBS = -MINIOBJS = $(ARCHMINIOBJS) miniinit.$(OBJEXT) miniprelude.$(OBJEXT) +MINIOBJS = $(ARCHMINIOBJS) miniinit.$(OBJEXT) dmyext.$(OBJEXT) miniprelude.$(OBJEXT) ENC_MK = enc.mk COMMONOBJS = array.$(OBJEXT) \ Index: win32/Makefile.sub =================================================================== --- win32/Makefile.sub (revision 49890) +++ win32/Makefile.sub (revision 49891) @@ -941,7 +941,7 @@ miniruby: miniruby$(EXEEXT) https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L941 miniruby$(EXEEXT): @echo $(LIBS) $(ECHO) linking $(@:\=/) - $(Q) $(PURIFY) $(CC) $(MAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS) $(LIBS) -Fe$@ -link $(LDFLAGS) + $(Q) $(PURIFY) $(CC) $(MAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(LIBS) -Fe$@ -link $(LDFLAGS) @$(RM) miniruby.lib miniruby.exp $(Q) miniruby.exe -v $(Q) $(LDSHARED_1) Index: Makefile.in =================================================================== --- Makefile.in (revision 49890) +++ Makefile.in (revision 49891) @@ -216,7 +216,7 @@ all: https://github.com/ruby/ruby/blob/trunk/Makefile.in#L216 miniruby$(EXEEXT): @-if test -f $@; then $(MV) -f $@ $@.old; $(RM) $@.old; fi $(ECHO) linking $@ - $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS) $(MAINLIBS) $(LIBS) $(OUTFLAG)$@ + $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(MAINLIBS) $(LIBS) $(OUTFLAG)$@ $(PROGRAM): @$(RM) $@ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/