[#34911] erb still treats $KCODE — "Yusuke ENDOH" <mame@...>

遠藤です。

16 messages 2008/06/03

[#34923] open() and encodings — "NARUSE, Yui" <naruse@...>

成瀬です。

53 messages 2008/06/03
[#34924] Re: open() and encodings — Yukihiro Matsumoto <matz@...> 2008/06/04

まつもと ゆきひろです

[#34931] Re: open() and encodings — "NARUSE, Yui" <naruse@...> 2008/06/04

成瀬です。

[#34934] Re: open() and encodings — Yukihiro Matsumoto <matz@...> 2008/06/05

まつもと ゆきひろです

[#34935] Re: open() and encodings — "U.Nakamura" <usa@...> 2008/06/05

こんにちは、なかむら(う)です。

[#34936] Re: open() and encodings — Yukihiro Matsumoto <matz@...> 2008/06/05

まつもと ゆきひろです

[#34937] Re: open() and encodings — "U.Nakamura" <usa@...> 2008/06/05

こんにちは、なかむら(う)です。

[#34948] Re: open() and encodings — Hidetoshi NAGAI <nagai@...> 2008/06/05

永井@知能.九工大です.

[#34961] Re: open() and encodings — "NARUSE, Yui" <naruse@...> 2008/06/05

成瀬です。

[#34997] Re: [ruby-changes:5517] Ruby:r17021 (trunk): * vm_insnhelper.c, vm.c, proc.c (proc_call): allow call method with — SASADA Koichi <ko1@...>

 ささだです.

19 messages 2008/06/08
[#34998] Re: [ruby-changes:5517] Ruby:r17021 (trunk): * vm_insnhelper.c, vm.c, proc.c (proc_call): allow call method with — Yukihiro Matsumoto <matz@...> 2008/06/08

まつもと ゆきひろです

[#34999] Re: [ruby-changes:5517] Ruby:r17021 (trunk): * vm_insnhelper.c, vm.c, proc.c (proc_call): allow call method with — SASADA Koichi <ko1@...> 2008/06/08

 ささだです.

[#35000] Re: [ruby-changes:5517] Ruby:r17021 (trunk): * vm_insnhelper.c, vm.c, proc.c (proc_call): allow call method with — Yukihiro Matsumoto <matz@...> 2008/06/08

まつもと ゆきひろです

[#35001] Re: [ruby-changes:5517] Ruby:r17021 (trunk): * vm_insnhelper.c, vm.c, proc.c (proc_call): allow call method with — SASADA Koichi <ko1@...> 2008/06/08

 ささだです.

[#35003] Re: [ruby-changes:5517] Ruby:r17021 (trunk): * vm_insnhelper.c, vm.c, proc.c (proc_call): allow call method with — Yukihiro Matsumoto <matz@...> 2008/06/08

まつもと ゆきひろです

[#35007] Re: [ruby-changes:5517] Ruby:r17021 (trunk): * vm_insnhelper.c, vm.c, proc.c (proc_call): allow call method with — "Yusuke ENDOH" <mame@...> 2008/06/09

遠藤です。

[#35013] Re: [ruby-changes:5517] Ruby:r17021 (trunk): * vm_insnhelper.c, vm.c, proc.c (proc_call): allow call method with — Yukihiro Matsumoto <matz@...> 2008/06/09

まつもと ゆきひろです

[#35019] Re: [ruby-changes:5517] Ruby:r17021 (trunk): * vm_insnhelper.c, vm.c, proc.c (proc_call): allow call method with — "Yusuke ENDOH" <mame@...> 2008/06/09

遠藤です。

[#35021] Re: [ruby-changes:5517] Ruby:r17021 (trunk): * vm_insnhelper.c, vm.c, proc.c (proc_call): allow call method with — Yukihiro Matsumoto <matz@...> 2008/06/09

まつもと ゆきひろです

[#35020] Ruby 1.8.7-p17 has been released — "Akinori MUSHA" <knu@...>

 Ruby 1.8.7-p17 をリリースしました。

13 messages 2008/06/09

[#35044] deadlock detection for 1.9 — "Yusuke ENDOH" <mame@...>

遠藤です。

14 messages 2008/06/10

[#35108] Re: [ruby-list:44988] Re: 各ブランチの計画 — Urabe Shyouhei <shyouhei@...>

卜部です。

15 messages 2008/06/15

[#35200] Win32 Unicode console output — Tietew <tietew@...>

Tietew です。

22 messages 2008/06/22
[#35270] Re: Win32 Unicode console output — "NARUSE, Yui" <naruse@...> 2008/06/29

[#35226] [PATCH] freeze required_paths in gem_prelude.rb — "Keita Yamaguchi" <keita.yamaguchi@...>

山口と申します。

14 messages 2008/06/25
[#35228] Re: [PATCH] freeze required_paths in gem_prelude.rb — "Yusuke ENDOH" <mame@...> 2008/06/25

遠藤です。

[#35230] Re: [PATCH] freeze required_paths in gem_prelude.rb — Yukihiro Matsumoto <matz@...> 2008/06/25

まつもと ゆきひろです

[#35227] [Bug:trunk] Re: [ruby-cvs:24798] Ruby:r17573 (trunk): * parse.y (primary): make functional-style not operator to act — "U.Nakamura" <usa@...>

こんにちは、なかむら(う)です。

7 messages 2008/06/25

[#35247] Re: [ruby-list:45128] Re: Ruby 1.9.0/1.8.7/1.8.6/1.8.5 new releases (Security Fix) — Urabe Shyouhei <shyouhei@...>

卜部です。-devに振ります。ひょっとしてこんなパッチでSEGVのほうはおさまっ

13 messages 2008/06/26
[#35250] Re: [ruby-list:45128] Re: Ruby 1.9.0/1.8.7/1.8.6/1.8.5 new releases (Security Fix) — Yukihiro Matsumoto <matz@...> 2008/06/26

まつもと ゆきひろです

[#35273] $SAFEの今後 — Urabe Shyouhei <shyouhei@...>

〜これまでのあらすじ〜

24 messages 2008/06/30
[#35293] Re: $SAFEの今後 — Yukihiro Matsumoto <matz@...> 2008/07/01

まつもと ゆきひろです

[#35298] Re: $SAFEの今後 — Urabe Shyouhei <shyouhei@...> 2008/07/01

卜部です。

[#35303] Re: $SAFEの今後 — Yukihiro Matsumoto <matz@...> 2008/07/01

まつもと ゆきひろです

[#35304] Re: $SAFEの今後 — Urabe Shyouhei <shyouhei@...> 2008/07/01

卜部です。

[#35305] Re: $SAFEの今後 — Yukihiro Matsumoto <matz@...> 2008/07/01

まつもと ゆきひろです

[#35306] Re: $SAFEの今後 — "Shugo Maeda" <shugo@...> 2008/07/02

前田です。

[#35278] [BUG] test_win32ole_event.rb in trunk — Masaki Suketa <masaki.suketa@...>

助田です。

22 messages 2008/06/30
[#35281] Re: [BUG] test_win32ole_event.rb in trunk — "U.Nakamura" <usa@...> 2008/06/30

こんにちは、なかむら(う)です。

[#35282] Re: [BUG] test_win32ole_event.rb in trunk — arton <artonx@...> 2008/06/30

artonです。

[#35295] Re: [BUG] test_win32ole_event.rb in trunk — Masaki Suketa <masaki.suketa@...> 2008/07/01

助田です。

[ruby-dev:35152] PATCH for MySQL/Ruby

From: Nobuyoshi Nakada <nobu@...>
Date: 2008-06-18 06:15:01 UTC
List: ruby-dev #35152
なかだです。

MySQL/Ruby 2.8pre2をみてみたのですが、やや問題があるようです。

= 別ディレクトリでコンパイルできない。
  *.cを自動で探すのはソースディレクトリです。この場合はソース全
  体をコピーしなくとも、ヘッダに分けるだけで充分だと思います。

* RUBYY_VERSION_CODEをみている
  rb_str_set_len()を使うのはRSTRING_LEN()がないときでいいと思い
  ます。

  RUBY_VERSION_CODE < 160 のときにTypeError()やRaise()を使ってい
  ますが、この関数は1.3ではすでに廃止されています。なので、1.4で
  は動かないはずです。また、他のところでは無条件でrb_raiseを使っ
  ているので、1.2以前でもダメなはずです。つまり、もう1.4以前では
  使われていない、とみなしてもいいのでは。


Index: mysql-ruby-2.7.5/extconf.rb
===================================================================
--- mysql-ruby-2.7.5/extconf.rb~	2006-10-29 23:59:44.000000000 +0900
+++ mysql-ruby-2.7.5/extconf.rb	2008-06-16 12:18:51.000000000 +0900
@@ -61,11 +61,7 @@
 error_syms.uniq!
 
-newf = File::open('mysql.c', 'w')
-IO::foreach('mysql.c.in') do |l|
-  newf.puts l
-  if l =~ /\/\* Mysql::Error constant \*\// then
-    error_syms.each do |s|
-      newf.puts "    rb_define_const(eMysql, \"#{s}\", INT2NUM(#{s}));"
-    end
+File::open('error_const.h', 'w') do |f|
+  error_syms.each do |s|
+    f.puts "    rb_define_mysql_const(#{s});"
   end
 end
Index: mysql-ruby-2.7.5/mysql.c
===================================================================
--- mysql-ruby-2.7.5/mysql.c.in~	2008-03-08 01:30:47.000000000 +0900
+++ mysql-ruby-2.7.5/mysql.c	2008-06-16 12:20:36.000000000 +0900
@@ -4,5 +4,4 @@
 
 #include "ruby.h"
-#include "version.h"
 #ifdef HAVE_MYSQL_H
 #include <mysql.h>
@@ -19,4 +18,12 @@
 #define GC_STORE_RESULT_LIMIT 20
 
+#ifndef RSTRING_PTR
+#define RSTRING_PTR(str) RSTRING(str)->ptr
+#endif
+#ifndef RSTRING_LEN
+#define RSTRING_LEN(str) RSTRING(str)->len
+#define rb_str_set_len(str, length) (RSTRING_LEN(str) = (length))
+#endif
+
 #ifndef Qtrue		/* ruby 1.2.x ? */
 #define	Qtrue		TRUE
@@ -278,6 +285,6 @@
     VALUE ret;
     Check_Type(str, T_STRING);
-    ret = rb_str_new(0, (RSTRING(str)->len)*2+1);
-    RSTRING(ret)->len = mysql_escape_string(RSTRING(ret)->ptr, RSTRING(str)->ptr, RSTRING(str)->len);
+    ret = rb_str_new(0, (RSTRING_LEN(str))*2+1);
+    rb_str_set_len(ret, mysql_escape_string(RSTRING_PTR(ret), RSTRING_PTR(str), RSTRING_LEN(str)));
     return ret;
 }
@@ -412,6 +419,6 @@
     VALUE ret;
     Check_Type(str, T_STRING);
-    ret = rb_str_new(0, (RSTRING(str)->len)*2+1);
-    RSTRING(ret)->len = mysql_real_escape_string(m, RSTRING(ret)->ptr, RSTRING(str)->ptr, RSTRING(str)->len);
+    ret = rb_str_new(0, (RSTRING_LEN(str))*2+1);
+    rb_str_set_len(ret, mysql_real_escape_string(m, RSTRING_PTR(ret), RSTRING_PTR(str), RSTRING_LEN(str)));
     return ret;
 }
@@ -723,5 +730,5 @@
 	    mysql_raise(m);
 #endif
-	if (mysql_real_query(m, RSTRING(sql)->ptr, RSTRING(sql)->len) != 0)
+	if (mysql_real_query(m, RSTRING_PTR(sql), RSTRING_LEN(sql)) != 0)
 	    mysql_raise(m);
 	do {
@@ -743,5 +750,5 @@
 	return obj;
     }
-    if (mysql_real_query(m, RSTRING(sql)->ptr, RSTRING(sql)->len) != 0)
+    if (mysql_real_query(m, RSTRING_PTR(sql), RSTRING_LEN(sql)) != 0)
 	mysql_raise(m);
     if (GetMysqlStruct(obj)->query_with_result == Qfalse)
@@ -895,9 +902,5 @@
 {
     if (TYPE(flag) != T_TRUE && TYPE(flag) != T_FALSE)
-#if RUBY_VERSION_CODE < 160
-	TypeError("invalid type, required true or false.");
-#else
         rb_raise(rb_eTypeError, "invalid type, required true or false.");
-#endif
     GetMysqlStruct(obj)->query_with_result = flag;
     return flag;
@@ -973,9 +976,5 @@
     n = NUM2INT(nr);
     if (n >= max)
-#if RUBY_VERSION_CODE < 160
-        Raise(eMysql, "%d: out of range (max: %d)", n, max-1);
-#else
         rb_raise(eMysql, "%d: out of range (max: %d)", n, max-1);
-#endif
 #if MYSQL_VERSION_ID >= 32226
     return make_field_obj(mysql_fetch_field_direct(res, n));
@@ -1046,6 +1045,6 @@
 	else {
 	    col = rb_tainted_str_new(fields[i].table, strlen(fields[i].table)+strlen(fields[i].name)+1);
-	    RSTRING(col)->ptr[strlen(fields[i].table)] = '.';
-	    strcpy(RSTRING(col)->ptr+strlen(fields[i].table)+1, fields[i].name);
+	    RSTRING_PTR(col)[strlen(fields[i].table)] = '.';
+	    strcpy(RSTRING_PTR(col)+strlen(fields[i].table)+1, fields[i].name);
 	}
 	rb_hash_aset(hash, col, row[i]? rb_tainted_str_new(row[i], lengths[i]): Qnil);
@@ -1171,6 +1170,6 @@
 {
     VALUE n = rb_iv_get(obj, "name");
-    VALUE s = rb_str_new(0, RSTRING(n)->len + 16);
-    sprintf(RSTRING(s)->ptr, "#<Mysql::Field:%s>", RSTRING(n)->ptr);
+    VALUE s = rb_str_new(0, RSTRING_LEN(n) + 16);
+    sprintf(RSTRING_PTR(s), "#<Mysql::Field:%s>", RSTRING_PTR(n));
     return s;
 }
@@ -1297,5 +1296,5 @@
 	    s->result.bind[i].buffer_type = MYSQL_TYPE_DATETIME;
 	else
-	    rb_raise(rb_eTypeError, "unrecognized class: %s", RSTRING(rb_inspect(argv[i]))->ptr);
+	    rb_raise(rb_eTypeError, "unrecognized class: %s", RSTRING_PTR(rb_inspect(argv[i])));
 	if (mysql_stmt_bind_result(s->stmt, s->result.bind))
 	    mysql_stmt_raise(s->stmt);
@@ -1620,5 +1619,5 @@
     check_stmt_closed(obj);
     Check_Type(query, T_STRING);
-    if (mysql_stmt_prepare(s->stmt, RSTRING(query)->ptr, RSTRING(query)->len))
+    if (mysql_stmt_prepare(s->stmt, RSTRING_PTR(query), RSTRING_LEN(query)))
 	mysql_stmt_raise(s->stmt);
 
@@ -1717,5 +1716,5 @@
 	    mysql_stmt_raise(s->stmt);
     }
-    if (mysql_stmt_send_long_data(s->stmt, c, RSTRING(data)->ptr, RSTRING(data)->len))
+    if (mysql_stmt_send_long_data(s->stmt, c, RSTRING_PTR(data), RSTRING_LEN(data)))
 	mysql_stmt_raise(s->stmt);
     return obj;
@@ -2233,3 +2232,5 @@
 
     /* Mysql::Error constant */
+#define rb_define_mysql_const(s) rb_define_const(eMysql, #s, INT2NUM(s))
+#include "error_const.h"
 }
Index: mysql-ruby-2.8pre2/extconf.rb
===================================================================
--- mysql-ruby-2.8pre2/extconf.rb~	2007-12-18 08:46:30.000000000 +0900
+++ mysql-ruby-2.8pre2/extconf.rb	2008-06-16 12:17:28.000000000 +0900
@@ -61,11 +61,7 @@
 error_syms.uniq!
 
-newf = File::open('mysql.c', 'w')
-IO::foreach('mysql.c.in') do |l|
-  newf.puts l.gsub(/%RUBY_VERSION%/, RUBY_VERSION.gsub(/\D/, ''))
-  if l =~ /\/\* Mysql::Error constant \*\// then
-    error_syms.each do |s|
-      newf.puts "    rb_define_const(eMysql, \"#{s}\", INT2NUM(#{s}));"
-    end
+File::open('error_const.h', 'w') do |f|
+  error_syms.each do |s|
+    f.puts "    rb_define_mysql_const(#{s});"
   end
 end
Index: mysql-ruby-2.8pre2/mysql.c
===================================================================
--- mysql-ruby-2.8pre2/mysql.c.in	2008-03-08 01:16:28.000000000 +0900
+++ mysql-ruby-2.8pre2/mysql.c	2008-06-16 12:15:14.000000000 +0900
@@ -4,5 +4,4 @@
 
 #include "ruby.h"
-#define RUBY_VERSION_CODE %RUBY_VERSION%
 #ifdef HAVE_MYSQL_H
 #include <mysql.h>
@@ -19,4 +18,12 @@
 #define GC_STORE_RESULT_LIMIT 20
 
+#ifndef RSTRING_PTR
+#define RSTRING_PTR(str) RSTRING(str)->ptr
+#endif
+#ifndef RSTRING_LEN
+#define RSTRING_LEN(str) RSTRING(str)->len
+#define rb_str_set_len(str, length) (RSTRING_LEN(str) = (length))
+#endif
+
 #ifndef Qtrue		/* ruby 1.2.x ? */
 #define	Qtrue		TRUE
@@ -283,9 +290,5 @@
     ret = rb_str_new(0, (RSTRING_LEN(str))*2+1);
     len = mysql_escape_string(RSTRING_PTR(ret), RSTRING_PTR(str), RSTRING_LEN(str));
-#if RUBY_VERSION_CODE < 190
-    RSTRING(ret)->len = len;
-#else
     rb_str_set_len(ret, len);
-#endif
     return ret;
 }
@@ -423,9 +426,5 @@
     ret = rb_str_new(0, (RSTRING_LEN(str))*2+1);
     len = mysql_real_escape_string(m, RSTRING_PTR(ret), RSTRING_PTR(str), RSTRING_LEN(str));
-#if RUBY_VERSION_CODE < 190
-    RSTRING(ret)->len = len;
-#else
     rb_str_set_len(ret, len);
-#endif
     return ret;
 }
@@ -905,9 +904,5 @@
 {
     if (TYPE(flag) != T_TRUE && TYPE(flag) != T_FALSE)
-#if RUBY_VERSION_CODE < 160
-	TypeError("invalid type, required true or false.");
-#else
         rb_raise(rb_eTypeError, "invalid type, required true or false.");
-#endif
     GetMysqlStruct(obj)->query_with_result = flag;
     return flag;
@@ -983,9 +978,5 @@
     n = NUM2INT(nr);
     if (n >= max)
-#if RUBY_VERSION_CODE < 160
-        Raise(eMysql, "%d: out of range (max: %d)", n, max-1);
-#else
         rb_raise(eMysql, "%d: out of range (max: %d)", n, max-1);
-#endif
 #if MYSQL_VERSION_ID >= 32226
     return make_field_obj(mysql_fetch_field_direct(res, n));
@@ -2264,3 +2255,5 @@
 
     /* Mysql::Error constant */
+#define rb_define_mysql_const(s) rb_define_const(eMysql, #s, INT2NUM(s))
+#include "error_const.h"
 }


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦

In This Thread

Prev Next