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

* common.mk (enc.mk): depends on $(RBCONFIG) instead of rbconfig.rb.

* encoding.c (Init_Encoding): ISO-8859-1 is no longer a replica.

* regenc.h (OnigEncodingDefine): names of extension and encoding can
  differ.

* enc/Makefile.in: always shared.

* enc/depend (deffile): should not upcase.

* enc/{ascii,euc_jp,sjis,utf8,iso_8859_{1..16}}.c: fix for Init.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-12-21 02:23:26 +00:00
parent d45cfa45ab
commit 817a4e3c83
25 changed files with 43 additions and 32 deletions

View file

@ -1,3 +1,18 @@
Fri Dec 21 11:23:24 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (enc.mk): depends on $(RBCONFIG) instead of rbconfig.rb.
* encoding.c (Init_Encoding): ISO-8859-1 is no longer a replica.
* regenc.h (OnigEncodingDefine): names of extension and encoding can
differ.
* enc/Makefile.in: always shared.
* enc/depend (deffile): should not upcase.
* enc/{ascii,euc_jp,sjis,utf8,iso_8859_{1..16}}.c: fix for Init.
Fri Dec 21 09:26:48 2007 Tanaka Akira <akr@fsij.org>
* tool/compile_prelude.rb: use erb.
@ -78,7 +93,6 @@ Thu Dec 20 17:07:54 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* enc/depend, enc/make_encmake.rb: fix for Windows.
* enc/{ascii,euc_jp,sjis,utf8,iso_8859_{1..16}}.c: renamed.
Thu Dec 20 16:42:55 2007 Koichi Sasada <ko1@atdot.net>

View file

@ -344,7 +344,7 @@ encs: enc.mk
$(MAKE) -f enc.mk -$(MAKEFLAGS)
enc.mk: $(srcdir)/enc/make_encmake.rb $(srcdir)/enc/Makefile.in $(srcdir)/enc/depend \
$(srcdir)/lib/mkmf.rb rbconfig.rb
$(srcdir)/lib/mkmf.rb $(RBCONFIG)
$(MINIRUBY) $(srcdir)/enc/make_encmake.rb --builtin-encs="$(BUILTIN_ENCOBJS)" $@
.PRECIOUS: $(MKFILES)

View file

@ -16,14 +16,14 @@ BUILTIN_ENCS = ascii.c \
RUBY_SO_NAME = @RUBY_SO_NAME@
LIBRUBY = @LIBRUBY@
LIBRUBY_A = @LIBRUBY_A@
LIBRUBYARG_STATIC = @LIBRUBYARG_STATIC@
LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
LIBRUBYARG_STATIC = $(LIBRUBYARG_SHARED)
empty =
CC = @CC@
OUTFLAG = @OUTFLAG@$(empty)
CFLAGS = @CFLAGS@ @ARCH_FLAG@
CFLAGS = $(CCDLFLAGS) @CFLAGS@ @ARCH_FLAG@
CCDLFLAGS = @CCDLFLAGS@
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(top_srcdir)
DEFS = @DEFS@
CPPFLAGS = @CPPFLAGS@ -DONIG_ENC_REGISTER=rb_enc_register

View file

@ -38,7 +38,7 @@ ascii_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
return FALSE;
}
OnigEncodingDefine(ASCII) = {
OnigEncodingDefine(ascii, ASCII) = {
onigenc_single_byte_mbc_enc_len,
"ASCII-8BIT",/* name */
1, /* max byte length */

View file

@ -35,9 +35,9 @@ $(ENCSODIR)/<%e%>.$(DLEXT): <%deps%>
! end
! if DEFFILE
! encs.each do |e|
<%e%>-$(arch).def:
<%e%>-$(arch).def: enc.mk
echo EXPORTS > $@
echo <%EXPORT_PREFIX%>Init_<%e.upcase%> >> $@
echo <%EXPORT_PREFIX%>Init_<%e%> >> $@
! end
! end

View file

@ -341,7 +341,7 @@ get_ctype_code_range(int ctype, OnigCodePoint* sb_out,
}
OnigEncodingDefine(EUC_JP) = {
OnigEncodingDefine(euc_jp, EUC_JP) = {
mbc_enc_len,
"EUC-JP", /* name */
3, /* max enc length */

View file

@ -254,7 +254,7 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
return FALSE;
}
OnigEncodingDefine(ISO_8859_1) = {
OnigEncodingDefine(iso_8859_1, ISO_8859_1) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-1", /* name */
1, /* max enc length */

View file

@ -224,7 +224,7 @@ iso_8859_10_get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
OnigEncodingDefine(ISO_8859_10) = {
OnigEncodingDefine(iso_8859_10, ISO_8859_10) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-10", /* name */
1, /* max enc length */

View file

@ -76,7 +76,7 @@ iso_8859_11_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding e
return FALSE;
}
OnigEncodingDefine(ISO_8859_11) = {
OnigEncodingDefine(iso_8859_11, ISO_8859_11) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-11", /* name */
1, /* max enc length */

View file

@ -213,7 +213,7 @@ iso_8859_13_get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
OnigEncodingDefine(ISO_8859_13) = {
OnigEncodingDefine(iso_8859_13, ISO_8859_13) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-13", /* name */
1, /* max enc length */

View file

@ -225,7 +225,7 @@ iso_8859_14_get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
OnigEncodingDefine(ISO_8859_14) = {
OnigEncodingDefine(iso_8859_14, ISO_8859_14) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-14", /* name */
1, /* max enc length */

View file

@ -219,7 +219,7 @@ iso_8859_15_get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
OnigEncodingDefine(ISO_8859_15) = {
OnigEncodingDefine(iso_8859_15, ISO_8859_15) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-15", /* name */
1, /* max enc length */

View file

@ -222,7 +222,7 @@ iso_8859_16_get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
OnigEncodingDefine(ISO_8859_16) = {
OnigEncodingDefine(iso_8859_16, ISO_8859_16) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-16", /* name */
1, /* max enc length */

View file

@ -219,7 +219,7 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
return FALSE;
}
OnigEncodingDefine(ISO_8859_2) = {
OnigEncodingDefine(iso_8859_2, ISO_8859_2) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-2", /* name */
1, /* max enc length */

View file

@ -219,7 +219,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
OnigEncodingDefine(ISO_8859_3) = {
OnigEncodingDefine(iso_8859_3, ISO_8859_3) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-3", /* name */
1, /* max enc length */

View file

@ -221,7 +221,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
OnigEncodingDefine(ISO_8859_4) = {
OnigEncodingDefine(iso_8859_4, ISO_8859_4) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-4", /* name */
1, /* max enc length */

View file

@ -209,7 +209,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
OnigEncodingDefine(ISO_8859_5) = {
OnigEncodingDefine(iso_8859_5, ISO_8859_5) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-5", /* name */
1, /* max enc length */

View file

@ -76,7 +76,7 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
return FALSE;
}
OnigEncodingDefine(ISO_8859_6) = {
OnigEncodingDefine(iso_8859_6, ISO_8859_6) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-6", /* name */
1, /* max enc length */

View file

@ -206,7 +206,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
}
OnigEncodingDefine(ISO_8859_7) = {
OnigEncodingDefine(iso_8859_7, ISO_8859_7) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-7", /* name */
1, /* max enc length */

View file

@ -76,7 +76,7 @@ iso_8859_8_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding en
return FALSE;
}
OnigEncodingDefine(ISO_8859_8) = {
OnigEncodingDefine(iso_8859_8, ISO_8859_8) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-8", /* name */
1, /* max enc length */

View file

@ -213,7 +213,7 @@ iso_8859_9_get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
OnigEncodingDefine(ISO_8859_9) = {
OnigEncodingDefine(iso_8859_9, ISO_8859_9) = {
onigenc_single_byte_mbc_enc_len,
"ISO-8859-9", /* name */
1, /* max enc length */

View file

@ -351,7 +351,7 @@ get_ctype_code_range(int ctype, OnigCodePoint* sb_out,
}
}
OnigEncodingDefine(SJIS) = {
OnigEncodingDefine(sjis, SJIS) = {
mbc_enc_len,
"Shift_JIS", /* name */
2, /* max byte length */

View file

@ -486,7 +486,7 @@ utf8_get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}
OnigEncodingDefine(UTF8) = {
OnigEncodingDefine(utf8, UTF8) = {
utf8_mbc_enc_len,
"UTF-8", /* name */
6, /* max byte length */

View file

@ -773,9 +773,6 @@ Init_Encoding(void)
rb_define_singleton_method(rb_cEncoding, "default_external", get_default_external, 0);
/* should be imported from Oniguruma */
rb_enc_replicate("ISO-8859-1", rb_enc_find(rb_enc_name(ONIG_ENCODING_ASCII)));
/* dummy for unsupported, statefull encoding */
rb_enc_replicate("ISO-2022-JP", rb_enc_find(rb_enc_name(ONIG_ENCODING_ASCII)));

View file

@ -181,9 +181,9 @@ ONIG_EXTERN const unsigned short OnigEncAsciiCtypeTable[];
extern int ONIG_ENC_REGISTER(const char *, OnigEncodingType*);
#define OnigEncodingName(n) encoding_##n
#define OnigEncodingDeclare(n) static OnigEncodingType OnigEncodingName(n)
#define OnigEncodingDefine(n) \
#define OnigEncodingDefine(f,n) \
OnigEncodingDeclare(n); \
void Init_##n(void) { \
void Init_##f(void) { \
ONIG_ENC_REGISTER(OnigEncodingName(n).name, \
&OnigEncodingName(n)); \
} \
@ -191,7 +191,7 @@ extern int ONIG_ENC_REGISTER(const char *, OnigEncodingType*);
#else
#define OnigEncodingName(n) OnigEncoding##n
#define OnigEncodingDeclare(n) OnigEncodingType OnigEncodingName(n)
#define OnigEncodingDefine(n) OnigEncodingDeclare(n)
#define OnigEncodingDefine(f,n) OnigEncodingDeclare(n)
#endif
#endif /* REGENC_H */