From: Hidetoshi NAGAI Date: 2004-04-15T00:13:01+09:00 Subject: Re: NEW trial (RC?) version of Ruby/Tk ----Next_Part(Thu_Apr_15_00:12:59_2004_697)-- Content-Type: Multipart/Mixed; boundary="--Next_Part(Thu_Apr_15_00:12:59_2004_697)--" ----Next_Part(Thu_Apr_15_00:12:59_2004_697)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, From: Hidetoshi NAGAI Subject: NEW trial (RC?) version of Ruby/Tk Date: Wed, 14 Apr 2004 21:51:02 +0900 Message-ID: <20040414.215101.41658115.nagai@ai.kyutech.ac.jp> > Please get the source archive from > http://www.dumbo.ai.kyutech.ac.jp/~nagai/rbtk20040414.tar.gz I'm very sorry. It's cannot be compiled with Tcl/Tk8.0. Please apply the attached patch. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) ----Next_Part(Thu_Apr_15_00:12:59_2004_697)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename=diff20040415 diff -ur ../20040414/tcltklib/extconf.rb ./tcltklib/extconf.rb --- ../20040414/tcltklib/extconf.rb 2004-04-14 21:13:53.000000000 +0900 +++ ./tcltklib/extconf.rb 2004-04-15 00:04:36.000000000 +0900 @@ -102,7 +102,7 @@ ** ** Ruby is compiled with --enable-pthread, but your Tcl/Tk libraries ** seems to be compiled without "pthread support". Although You can -** create tcltklib library, this combination may causes memory trouble +** create tcltklib library, this combination may cause memory trouble ** (e.g. "Hang-up" or "Segmentation Fault"). We recommend you to make ** both or neither support pthread. ** diff -ur ../20040414/tcltklib/tcltklib.c ./tcltklib/tcltklib.c --- ../20040414/tcltklib/tcltklib.c 2004-04-14 21:13:53.000000000 +0900 +++ ./tcltklib/tcltklib.c 2004-04-15 00:03:17.000000000 +0900 @@ -1184,6 +1184,9 @@ /* StringValue(res); */ res = rb_funcall(res, ID_message, 0, 0); +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 + Tcl_AppendResult(interp, RSTRING(res)->ptr, (char*)NULL); +#else /* to avoid a garbled error message dialog */ buf = ALLOC_N(char,(RSTRING(res)->len)+1); strncpy(buf, RSTRING(res)->ptr, RSTRING(res)->len); @@ -1198,7 +1201,7 @@ DUMP2("error message:%s", Tcl_DStringValue(&dstr)); free(buf); - +#endif rb_thread_critical = thr_crit_bup; return TCL_ERROR; @@ -1223,6 +1226,9 @@ /* StringValue(res); */ res = rb_funcall(res, ID_message, 0, 0); +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 + Tcl_AppendResult(interp, RSTRING(res)->ptr, (char*)NULL); +#else /* to avoid a garbled error message dialog */ buf = ALLOC_N(char,(RSTRING(res)->len)+1); strncpy(buf, RSTRING(res)->ptr, RSTRING(res)->len); @@ -1237,7 +1243,7 @@ DUMP2("error message:%s", Tcl_DStringValue(&dstr)); free(buf); - +#endif rb_thread_critical = thr_crit_bup; return TCL_ERROR; @@ -1252,6 +1258,9 @@ /* StringValue(res); */ res = rb_funcall(res, ID_message, 0, 0); +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 + Tcl_AppendResult(interp, RSTRING(res)->ptr, (char*)NULL); +#else /* to avoid a garbled error message dialog */ buf = ALLOC_N(char,(RSTRING(res)->len)+1); strncpy(buf, RSTRING(res)->ptr, RSTRING(res)->len); @@ -1266,7 +1275,7 @@ DUMP2("error message:%s", Tcl_DStringValue(&dstr)); free(buf); - +#endif rb_thread_critical = thr_crit_bup; return TCL_ERROR; @@ -1625,6 +1634,9 @@ /* StringValue(res); */ res = rb_funcall(res, ID_message, 0, 0); +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 + Tcl_AppendResult(interp, RSTRING(res)->ptr, (char*)NULL); +#else /* to avoid a garbled error message dialog */ buf = ALLOC_N(char,(RSTRING(res)->len)+1); strncpy(buf, RSTRING(res)->ptr, RSTRING(res)->len); @@ -1639,7 +1651,7 @@ DUMP2("error message:%s", Tcl_DStringValue(&dstr)); free(buf); - +#endif rb_thread_critical = thr_crit_bup; return TCL_ERROR; @@ -1664,6 +1676,9 @@ /* StringValue(res); */ res = rb_funcall(res, ID_message, 0, 0); +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 + Tcl_AppendResult(interp, RSTRING(res)->ptr, (char*)NULL); +#else /* to avoid a garbled error message dialog */ buf = ALLOC_N(char,(RSTRING(res)->len)+1); strncpy(buf, RSTRING(res)->ptr, RSTRING(res)->len); @@ -1678,7 +1693,7 @@ DUMP2("error message:%s", Tcl_DStringValue(&dstr)); free(buf); - +#endif rb_thread_critical = thr_crit_bup; return TCL_ERROR; @@ -1693,6 +1708,9 @@ /* StringValue(res); */ res = rb_funcall(res, ID_message, 0, 0); +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 + Tcl_AppendResult(interp, RSTRING(res)->ptr, (char*)NULL); +#else /* to avoid a garbled error message dialog */ buf = ALLOC_N(char,(RSTRING(res)->len)+1); strncpy(buf, RSTRING(res)->ptr, RSTRING(res)->len); @@ -1707,7 +1725,7 @@ DUMP2("error message:%s", Tcl_DStringValue(&dstr)); free(buf); - +#endif rb_thread_critical = thr_crit_bup; return TCL_ERROR; @@ -3495,8 +3513,9 @@ VALUE src; VALUE encodename; { -#ifdef TCL_UTF_MAX volatile VALUE str = src; + +#ifdef TCL_UTF_MAX Tcl_Interp *interp; Tcl_Encoding encoding; Tcl_DString dstr; @@ -3622,8 +3641,9 @@ VALUE src; VALUE encodename; { -#ifdef TCL_UTF_MAX volatile VALUE str = src; + +#ifdef TCL_UTF_MAX Tcl_Interp *interp; Tcl_Encoding encoding; Tcl_DString dstr; diff -ur ../20040414/tk/tkutil.c ./tk/tkutil.c --- ../20040414/tk/tkutil.c 2004-04-14 21:13:53.000000000 +0900 +++ ./tk/tkutil.c 2004-04-15 00:03:32.000000000 +0900 @@ -1067,7 +1067,13 @@ tkobj_path(self) VALUE self; { - return rb_ivar_get(self, ID_path); + volatile VALUE val = rb_ivar_get(self, ID_path); + + if (NIL_P(val)) { + return rb_str_new2(""); + } else { + return val; + } } /*************************************/ ----Next_Part(Thu_Apr_15_00:12:59_2004_697)---- ----Next_Part(Thu_Apr_15_00:12:59_2004_697)----