From: Katsuyuki Komatsu Date: 2000-05-25T22:07:19+09:00 Subject: [ruby-dev:9854] mswin32 racc support 小松です。 久しぶりにmswin32で拡張ライブラリを更新していたら raccとwin32oleで引っかかりました。 1. racc-1.0.2を作っていたら、regex.cからのEXPORTが不足していました。 さらに、ruby_ignorecaseとre_mbctabに__declspec(dllimport)が 無いため、strscan.soがAccess Violationで落ちます。 re.hとwin32/ruby.defの変更は良いとして、regex.hは この変更入れてもよいでしょうか? 2. win32ole-0.1.1をコンパイルしてみたらUSHORTが衝突してました。 defines.hのUSHORTの定義を削除。 cl -DIMPORT -I\usr\local\lib\ruby\1.5\i386-mswin32 -nologo -DNT=1 -MD -Zi /W3 -I/usr/local/include /c win32ole.c win32ole.c C:\Program Files\Microsoft Visual Studio\VC98\Include\ocidl.h(1616) : error C2061: 構文エラー : 識別子 'USHORT' がシンタックスエラーを起こしました。 …… win32ole.c(1451) : fatal error C1903: 直前のエラーを修復できません; コンパイルを中止します。 Thu May 25 22:01:32 2000 Katsuyuki Komatsu * defines.h: mswin32: remove obsolete USHORT definition. * re.h: mswin32: use EXTERN instead of extern. * regex.h: mswin32: export re_mbctab properly. * win32/win32.def: add ruby_ignorecase and regex.c's exports. diff -ru1p ruby-1.5.4.dist/defines.h ruby-1.5.4/defines.h --- ruby-1.5.4.dist/defines.h Sun May 14 01:12:15 2000 +++ ruby-1.5.4/defines.h Thu May 25 22:01:32 2000 @@ -33,5 +33,3 @@ #ifdef NT -#define USHORT _USHORT #include "win32/win32.h" -#undef USHORT #endif diff -ru1p ruby-1.5.4.dist/re.h ruby-1.5.4/re.h --- ruby-1.5.4.dist/re.h Mon May 1 18:41:28 2000 +++ ruby-1.5.4/re.h Thu May 25 22:01:32 2000 @@ -39,3 +39,3 @@ void rb_match_busy _((VALUE)); -extern int ruby_ignorecase; +EXTERN int ruby_ignorecase; diff -ru1p ruby-1.5.4.dist/regex.h ruby-1.5.4/regex.h --- ruby-1.5.4.dist/regex.h Thu May 25 14:55:06 2000 +++ ruby-1.5.4/regex.h Thu May 25 22:01:32 2000 @@ -92,3 +92,10 @@ -extern const unsigned char *re_mbctab; +#if defined IMPORT +extern __declspec(dllimport) +#elif defined EXPORT +extern __declspec(dllexport) +#else +extern +#endif +const unsigned char *re_mbctab; #if defined(__STDC__) diff -ru1p ruby-1.5.4.dist/win32/ruby.def ruby-1.5.4/win32/ruby.def --- ruby-1.5.4.dist/win32/ruby.def Thu May 25 14:55:12 2000 +++ ruby-1.5.4/win32/ruby.def Thu May 25 22:01:32 2000 @@ -90,2 +90,3 @@ EXPORTS ;re.c + ruby_ignorecase rb_cRegexp @@ -481,2 +482,13 @@ EXPORTS rb_set_kcode +;regex.c + ruby_re_set_casetable + ruby_re_compile_pattern + ruby_re_free_pattern + ruby_re_compile_fastmap + ruby_re_adjust_startpos + ruby_re_search + ruby_re_match + ruby_re_copy_registers + ruby_re_free_registers + ruby_re_mbcinit ;ruby.c -- 小松克行 / Katsuyuki Komatsu