diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-20 08:07:56 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-20 08:07:56 +0000 |
commit | dc4d4b3923cbb832f69abdc0df6d9ee0ea38cae1 (patch) | |
tree | fcfaf15c7c5843954940f34a66abee4e68901b89 /regenc.h | |
parent | be137f3601610491d4265a4f9c87bf52fef28d66 (diff) | |
download | ruby-dc4d4b3923cbb832f69abdc0df6d9ee0ea38cae1.tar.gz |
* common.mk (enc.mk): depends on rbconfig.rb.
* regenc.h (OnigEncodingDefine): external encoding definition macro.
* enc/Makefile.in: fix for linking.
* enc/depend, enc/make_encmake.rb: fix for Windows.
* enc/{ascii,euc_jp,sjis,utf8,iso_8859_{1..16}}.c: renamed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regenc.h')
-rw-r--r-- | regenc.h | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -177,5 +177,21 @@ ONIG_EXTERN const unsigned short OnigEncAsciiCtypeTable[]; (ONIGENC_IS_ASCII_CODE_CTYPE(code, ONIGENC_CTYPE_UPPER) ||\ ONIGENC_IS_ASCII_CODE_CTYPE(code, ONIGENC_CTYPE_LOWER)) +#ifdef ONIG_ENC_REGISTER +extern int ONIG_ENC_REGISTER(const char *, OnigEncodingType*); +#define OnigEncodingName(n) encoding_##n +#define OnigEncodingDeclare(n) static OnigEncodingType OnigEncodingName(n) +#define OnigEncodingDefine(n) \ + OnigEncodingDeclare(n); \ + void Init_##n(void) { \ + ONIG_ENC_REGISTER(OnigEncodingName(n).name, \ + &OnigEncodingName(n)); \ + } \ + OnigEncodingDeclare(n) +#else +#define OnigEncodingName(n) OnigEncoding##n +#define OnigEncodingDeclare(n) OnigEncodingType OnigEncodingName(n) +#define OnigEncodingDefine(n) OnigEncodingDeclare(n) +#endif #endif /* REGENC_H */ |