From f3ed7fa2335ae52b8c07ac4bd3e039628b6f1e8b Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 29 Jan 2008 09:05:50 +0000 Subject: [PATCH] * encoding.c (encdb_{replicate,alias,dummy,declare}): define only if NO_ENCDB_H is not defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ encoding.c | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 64f1b306eb..3161e8a554 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jan 29 18:05:48 2008 Nobuyoshi Nakada + + * encoding.c (encdb_{replicate,alias,dummy,declare}): define only if + NO_ENCDB_H is not defined. + Tue Jan 29 17:54:11 2008 NARUSE, Yui * enc/gbk.c (EncLen_gbk): too short. [ruby-dev:33497] diff --git a/encoding.c b/encoding.c index 71a531a0fd..dff815f266 100644 --- a/encoding.c +++ b/encoding.c @@ -34,17 +34,19 @@ static struct { void rb_enc_init(void); +#ifndef NO_ENCDB_H #undef ENC_REPLICATE #undef ENC_ALIAS #undef ENC_DUMMY static int encdb_replicate(const char *alias, const char *orig); static int encdb_alias(const char *alias, const char *orig); static int encdb_dummy(const char *name); -static void enc_declare(const char *name); +static void encdb_declare(const char *name); #define ENC_REPLICATE(name, orig) encdb_replicate(name, orig) #define ENC_ALIAS(name, orig) encdb_alias(name, orig) #define ENC_DUMMY(name) encdb_dummy(name) -#define ENC_DEFINE(name) enc_declare(name) +#define ENC_DEFINE(name) encdb_declare(name) +#endif static void enc_init_db(void) @@ -249,8 +251,9 @@ rb_enc_register(const char *name, rb_encoding *encoding) return index; } +#ifndef NO_ENCDB_H static void -enc_declare(const char *name) +encdb_declare(const char *name) { int idx = rb_enc_registered(name); if (idx < 0) { @@ -258,6 +261,7 @@ enc_declare(const char *name) } set_encoding_const(name, rb_enc_from_index(idx)); } +#endif static void enc_check_duplication(const char *name) @@ -289,6 +293,7 @@ rb_enc_replicate(const char *name, rb_encoding *encoding) return idx; } +#ifndef NO_ENCDB_H static int enc_replicate(int idx, const char *name, rb_encoding *origenc) { @@ -316,6 +321,7 @@ encdb_replicate(const char *name, const char *orig) } return enc_replicate(idx, name, rb_enc_from_index(origidx)); } +#endif int rb_define_dummy_encoding(const char *name) @@ -327,6 +333,7 @@ rb_define_dummy_encoding(const char *name) return index; } +#ifndef NO_ENCDB_H static int encdb_dummy(const char *name) { @@ -337,6 +344,7 @@ encdb_dummy(const char *name) ENC_SET_DUMMY(enc); return index; } +#endif int rb_enc_dummy_p(rb_encoding *enc) @@ -388,6 +396,7 @@ rb_enc_alias(const char *alias, const char *orig) return enc_alias(alias, idx); } +#ifndef NO_ENCDB_H static int encdb_alias(const char *alias, const char *orig) { @@ -398,6 +407,7 @@ encdb_alias(const char *alias, const char *orig) } return enc_alias(alias, idx); } +#endif enum { ENCINDEX_ASCII,