summaryrefslogtreecommitdiff
path: root/regenc.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-20 08:07:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-20 08:07:56 +0000
commitdc4d4b3923cbb832f69abdc0df6d9ee0ea38cae1 (patch)
treefcfaf15c7c5843954940f34a66abee4e68901b89 /regenc.h
parentbe137f3601610491d4265a4f9c87bf52fef28d66 (diff)
downloadruby-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.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/regenc.h b/regenc.h
index b9d96a6949..2512985ba0 100644
--- a/regenc.h
+++ b/regenc.h
@@ -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 */