Skip to content

Commit

Permalink
miniinit.c: minimum built-in encodings in miniruby
Browse files Browse the repository at this point in the history
* 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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Mar 8, 2015
1 parent 53662a7 commit db24cb7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ all:
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) $@
Expand Down
2 changes: 1 addition & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ NORMALMAINOBJ = main.$(OBJEXT)
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) \
Expand Down
9 changes: 9 additions & 0 deletions miniinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,12 @@ Init_enc_set_filesystem_encoding(void)
{
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");
}
2 changes: 1 addition & 1 deletion win32/Makefile.sub
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ miniruby: miniruby$(EXEEXT)
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)
Expand Down

0 comments on commit db24cb7

Please sign in to comment.