[#25636] [Oniguruma 3.X] reggnu.c — "K.Kosako" <sndgk393@...>

さっき気がついたのですが、元々は

15 messages 2005/02/05

[#25655] openssl binding for SSL_CTX_set_default_verify_paths and X509_STORE_set_default_paths — Tanaka Akira <akr@...17n.org>

open-uri で https を扱うことを考えていろいろと調べていた所、openssl で、

9 messages 2005/02/08
[#25670] Re: openssl binding for SSL_CTX_set_default_verify_paths and X509_STORE_set_default_paths — GOTOU Yuuzou <gotoyuzo@...> 2005/02/10

In message <876513vce0.fsf@serein.a02.aist.go.jp>,

[#25713] pthread trouble on sighandler — Hidetoshi NAGAI <nagai@...>

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

17 messages 2005/02/18
[#25714] Re: pthread trouble on sighandler — Yukihiro Matsumoto <matz@...> 2005/02/18

まつもと ゆきひろです

[#25755] I/O operation differs signal handler — Minero Aoki <aamine@...>

青木です。

14 messages 2005/02/24
[#25756] Re: I/O operation differs signal handler — Tanaka Akira <akr@...17n.org> 2005/02/24

In article <20050224091450P.aamine@loveruby.net>,

[ruby-dev:25644] Re: process to merge ruby-dl2

From: "U.Nakamura" <usa@...>
Date: 2005-02-06 15:55:51 UTC
List: ruby-dev #25644
こんにちは、なかむら(う)です。

In message "[ruby-dev:25494] Re: process to merge ruby-dl2"
    on Jan.24,2005 20:17:15, <ttate@ttsky.net> wrote:
| 既存のdlを使ったスクリプトも少し変更を加えると動きそうなので、ライブラリ名を
| 'dl'のままにして、来月あたりに既存のソースと入れ替えようと思います。

VC++でコンパイルが通るようにしてみました。
問題なければとりこんでください。

Index: ext/dl/cfunc.c
===================================================================
RCS file: /home/cvs/ruby/ext/dl/cfunc.c,v
retrieving revision 1.1
diff -u -1 -p -r1.1 cfunc.c
--- ext/dl/cfunc.c	4 Feb 2005 13:35:36 -0000	1.1
+++ ext/dl/cfunc.c	6 Feb 2005 15:53:15 -0000
@@ -227,2 +227,4 @@ rb_dlcfunc_inspect(VALUE self)
 /* # define DECL_FUNC(f,ret,args,calltype)  ret (*f)(args) */
+#elif defined(_MSC_VER)
+# define DECL_FUNC(f,ret,args,calltype)  ret (__##calltype *f)(args)
 #else
@@ -333,3 +335,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,long long,DLSTACK_PROTO,cdecl) = cfunc->ptr; \
+	    DECL_FUNC(f,LONG_LONG,DLSTACK_PROTO,cdecl) = cfunc->ptr; \
 	    LONG_LONG ret; \
@@ -431,3 +433,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,long long,DLSTACK_PROTO,stdcall) = cfunc->ptr; \
+	    DECL_FUNC(f,LONG_LONG,DLSTACK_PROTO,stdcall) = cfunc->ptr; \
 	    LONG_LONG ret; \
Index: ext/dl/cptr.c
===================================================================
RCS file: /home/cvs/ruby/ext/dl/cptr.c,v
retrieving revision 1.2
diff -u -1 -p -r1.2 cptr.c
--- ext/dl/cptr.c	6 Feb 2005 06:54:11 -0000	1.2
+++ ext/dl/cptr.c	6 Feb 2005 15:53:16 -0000
@@ -362,3 +362,3 @@ rb_dlptr_aref(int argc, VALUE argv[], VA
     }
-    return rb_tainted_str_new(RPTR_DATA(self)->ptr + offset, len);
+    return rb_tainted_str_new((char *)RPTR_DATA(self)->ptr + offset, len);
 }
@@ -394,3 +394,3 @@ rb_dlptr_aset(int argc, VALUE argv[], VA
     }
-    memcpy(RPTR_DATA(self)->ptr + offset, mem, len);
+    memcpy((char *)RPTR_DATA(self)->ptr + offset, mem, len);
     return Qnil;
Index: ext/dl/dl.c
===================================================================
RCS file: /home/cvs/ruby/ext/dl/dl.c,v
retrieving revision 1.26
diff -u -1 -p -r1.26 dl.c
--- ext/dl/dl.c	6 Feb 2005 02:32:40 -0000	1.26
+++ ext/dl/dl.c	6 Feb 2005 15:53:16 -0000
@@ -60,2 +60,11 @@ rb_dl_value2ptr(VALUE self, VALUE val)
 # define PRE_DECL_STDCALL   __attribute__((stdcall))
+# define MIDST_DECL_CDECL
+# define MIDST_DECL_STDCALL
+# define POST_DECL_CDECL
+# define POST_DECL_STDCALL
+#elif defined(_MSC_VER)
+# define PRE_DECL_CDECL
+# define PRE_DECL_STDCALL
+# define MIDST_DECL_CDECL     __cdecl
+# define MIDST_DECL_STDCALL   __stdcall
 # define POST_DECL_CDECL
Index: ext/dl/mkcallback.rb
===================================================================
RCS file: /home/cvs/ruby/ext/dl/mkcallback.rb,v
retrieving revision 1.8
diff -u -1 -p -r1.8 mkcallback.rb
--- ext/dl/mkcallback.rb	4 Feb 2005 13:35:36 -0000	1.8
+++ ext/dl/mkcallback.rb	6 Feb 2005 15:53:16 -0000
@@ -113,7 +113,6 @@ for calltype in CALLTYPES
 
-PRE_DECL_#{calltype.upcase} static #{DLTYPE[ty][:type]}
+PRE_DECL_#{calltype.upcase} static #{DLTYPE[ty][:type]} MIDST_DECL_#{calltype.upcase}
 #{func_name(ty,argc,n,calltype)}(#{(0...argc).collect{|i| "DLSTACK_TYPE stack" + i.to_s}.join(", ")}) POST_DECL_#{calltype.upcase}
 {
-    VALUE args[#{argc}];
-    VALUE ret, cb;
+    VALUE ret, cb#{argc > 0 ? ", args[#{argc}]" : ""};
 #{
@@ -124,3 +123,3 @@ PRE_DECL_#{calltype.upcase} static #{DLT
     cb = rb_ary_entry(rb_ary_entry(#{proc_entry}, #{ty}), #{(n * DLSTACK_SIZE) + argc});
-    ret = rb_funcall2(cb, cb_call, #{argc}, args);
+    ret = rb_funcall2(cb, cb_call, #{argc}, #{argc > 0 ? 'args' : 'NULL'});
     return #{DLTYPE[ty][:conv] ? DLTYPE[ty][:conv] % "ret" : ""};

それでは。
-- 
U.Nakamura <usa@garbagecollect.jp>



In This Thread