INFINITY問題からdiv問題へ
> missing.hの冒頭でmath.hをincludeするとどうでしょう
きれいさっぱり消えました!全然思いつきませんでした。どうもありがとうございます。
ところで、いろいろ消えて、こういうのも出ていたのがわかりました。
… compiling ../trunk/strftime.c "../trunk/strftime.c", line 166.9: 1506-236 (W) マクロ名 div が再定義されています。 "../trunk/strftime.c", line 166.9: 1506-358 (I) 「div」が /usr/include/stdlib.h の 634 行目に定義されています。 compiling ../trunk/string.c compiling ../trunk/struct.c compiling ../trunk/time.c "../trunk/time.c", line 156.9: 1506-236 (W) マクロ名 div が再定義されています。 "../trunk/time.c", line 156.9: 1506-358 (I) 「div」が /usr/include/stdlib.h の 634 行目に定義されています。 …
#include "ruby/ruby.h" → #include
% cat -n time.c|fgrep ' 156 ' 156 #define div(x,y) (rb_funcall((x), id_div, 1, (y))) % cat -n strftime.c|fgrep 166 166 #define div(x,y) (rb_funcall((x), rb_intern("div"), 1, (y)))
stdlib.hのインクルードは避けられそうもないので、マクロの名前を変えるか、それか直前にこれでごまかすとか。
#ifdef div #undef div #endif
ちょっとかっこ悪いですかね。