From: ARIMA Yasuhiro Date: 1998-08-28T10:49:07+09:00 Subject: [ruby-list:9314] Re: ruby 1.1c3 released Regard to "[ruby-list:9301] ruby 1.1c3 released" 有馬@FITECです。 ruby-1.1c3 を WATCOM C でコンパイルしてみました。 File BIGNUM.C: 107 return bignorm((VALUE)RBIGNUM(x)); /* __WATCOMC__ */ 1264 return big_mod((VALUE)v, max); /* __WATCOMC__ */ File MARSHAL.C: 668 r_regist((VALUE)big, arg); /* __WATCOMC__ */ File RE.C: 651 kcode_set_option((VALUE)re); /* __WATCOMC__ */ 関数に合わせて型キャストしただけです。 File FILE.C: 970 # ifndef __WATCOMC__ /* __WATCOMC__ */ 971 # define utimbuf _utimbuf /* __WATCOMC__ */ 972 # endif /* __WATCOMC__ */ WATCOM だと、utimbuf があるので使いません。 File STRING.C: 488 #ifdef _MSC_VER /* __WATCOMC__ */ 489 #define min(a,b) (((a)>(b))?(b):(a)) /* __WATCOMC__ */ 490 #endif /* __WATCOMC__ */ WATCOM C では、 min/max は定義済みですので外してます。 マクロでない、変数としても、min/max -> mn/mx ぐらいに変えておいたほうが 無難だと思います。 #ifdef min でもいいんですが。 File PARSE.C: 以下の行で、引数の型が合わないといわれてます。byacc を使ってます。 parse.y(2005): Error! E1071: Type of parameter 2 does not agree with previous definition list_append(list, NEW_STR(ss)); parse.y(2083): Error! E1071: Type of parameter 2 does not agree with previous definition list_append(list, NEW_STR(ss)); parse.y(2160): Error! E1071: Type of parameter 2 does not agree with previous definition yylval.node = NEW_CALL(NEW_STR(yylval.val), rb_intern("split"), 0); parse.y(2160): Error! E1071: Type of parameter 3 does not agree with previous definition yylval.node = NEW_CALL(NEW_STR(yylval.val), rb_intern("split"), 0); parse.y(2235): Error! E1071: Type of parameter 2 does not agree with previous definition list_append(list, NEW_STR(yylval.val)); parse.y(2240): Error! E1071: Type of parameter 2 does not agree with previous definition list_append(yylval.node, NEW_STR(str_new2("\n"))); parse.y(2242): Error! E1071: Type of parameter 2 does not agree with previous definition if (!list) list = NEW_DSTR(str); parse.y(2963): Error! E1071: Type of parameter 3 does not agree with previous definition yylval.node = NEW_BACK_REF(c); parse.y(2963): Error! E1071: Type of parameter 4 does not agree with previous definition yylval.node = NEW_BACK_REF(c); parse.y(2975): Error! E1071: Type of parameter 3 does not agree with previous definition yylval.node = NEW_NTH_REF(atoi(tok())); parse.y(2975): Error! E1071: Type of parameter 4 does not agree with previous definition yylval.node = NEW_NTH_REF(atoi(tok())); parse.y(3107): Error! E1071: Type of parameter 2 does not agree with previous definition list = NEW_DSTR(ss); parse.y(3110): Error! E1071: Type of parameter 2 does not agree with previous definition list_append(list, NEW_STR(ss)); parse.y(3142): Error! E1071: Type of parameter 2 does not agree with previous definition list_append(list, NEW_STR(str_new2("#$"))); parse.y(3208): Error! E1071: Type of parameter 2 does not agree with previous definition list_append(list, NEW_STR(str_new2("#"))); parse.y(3211): Error! E1071: Type of parameter 2 does not agree with previous definition list_append(list, NEW_STR(str_new(tok(), toklen()))); parse.y(3224): Error! E1071: Type of parameter 2 does not agree with previous definition node = NEW_EVSTR(tok(),toklen()); parse.y(3383): Error! E1071: Type of parameter 3 does not agree with previous definition return NEW_CALL(recv, id, narg==1?NEW_LIST(arg1):0); parse.y(3435): Error! E1071: Type of parameter 2 does not agree with previous definition return NEW_STR(str_new2(sourcefile)); parse.y(3438): Error! E1071: Type of parameter 2 does not agree with previous definition return NEW_LIT(INT2FIX(sourceline)); parse.y(3441): Error! E1147: Too many errors: compilation aborted if (dyna_in_block() && dyna_var_defined(id)) return NEW_DVAR(id); -- 有馬 康弘