From: Hidetoshi NAGAI Date: 2005-11-06T22:54:21+09:00 Subject: [ruby-dev:27649] Re: tcltkstub cause SEGV 永井@知能.九工大です. From: H.Yamamoto Subject: [ruby-dev:27648] Re: tcltkstub cause SEGV Date: Sun, 6 Nov 2005 22:09:19 +0900 Message-ID: <20051106220918.69233240.ocean@m2.ccsnet.ne.jp> > >いえ、現在作業中です。tcltklib.c にある tcl_eval を stubs.c に移動し、 > >stubs.h で置き換えるようにしようと思います。 > >(こうすれば tcltklib.c と stubs.c の両方で有効になるので) > > でも stub と関係ないものを stubs.c に入れるのは綺麗ではないかもしれませんね・・・ マニュアルに↓のようにあることに基づき ----------------------------------------------------------------------- tcl_platform This is an associative array whose elements contain information about the platform on which the appli- cation is running, such as the name of the (snip) threaded If this variable exists, then the inter- preter was compiled with threads enabled. ----------------------------------------------------------------------- 配列要素が存在するかを知りたいだけですので,今現在は Index: stubs.c =================================================================== RCS file: /var/cvs/src/ruby/ext/tk/stubs.c,v retrieving revision 1.4 diff -u -r1.4 stubs.c --- stubs.c 6 Nov 2005 12:45:44 -0000 1.4 +++ stubs.c 6 Nov 2005 13:44:39 -0000 @@ -34,7 +34,9 @@ return; } - if (Tcl_Eval(ip, "set ::tcl_platform(threaded)") == TCL_OK) { + /* If the variable "tcl_platform(threaded)" exists, + then the Tcl interpreter was compiled with threads enabled. */ + if (Tcl_GetVar2(ip, "tcl_platform", "threaded", TCL_GLOBAL_ONLY) != (char*)NULL) { #ifdef HAVE_NATIVETHREAD /* consistent */ #else としておくのがいいような気がしてます. -- 永井 秀利 (九工大 知能情報) nagai@ai.kyutech.ac.jp