[#26975] [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。

56 messages 2005/09/07
[#26976] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/07

まつもと ゆきひろです

[#26977] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/07

山本です。

[#26978] Re: [proposal] ANSI style function — nobu@... 2005/09/07

なかだです。

[#26979] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/07

山本です。

[#26980] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/07

まつもと ゆきひろです

[#26983] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/08

山本です。

[#26988] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/08

山本です。

[#26989] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/08

山本です。

[#26990] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/08

まつもと ゆきひろです

[#26991] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/08

山本です。

[#26995] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/09

山本です。

[#26996] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/09

まつもと ゆきひろです

[#26998] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/09

山本です。

[#27000] Re: [proposal] ANSI style function — Takahiro Kambe <taca@...> 2005/09/09

In message <20050909220539.E1B26BB8.ocean@m2.ccsnet.ne.jp>

[#27001] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27002] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27003] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/10

まつもと ゆきひろです

[#27004] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27005] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27006] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/10

まつもと ゆきひろです

[#27007] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27008] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/10

まつもと ゆきひろです

[#27009] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27011] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/10

まつもと ゆきひろです

[#27013] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27016] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/11

山本です。

[#27015] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/11

山本です。

[#26984] elimination of "extern int errno;" — Takahiro Kambe <taca@...>

こんにちは。

48 messages 2005/09/08
[#27023] sizeof(FILE) problem on DragonFly BSD — Takahiro Kambe <taca@...> 2005/09/12

In message <20050908.120716.71112483.taca@back-street.net>

[#27024] Re: sizeof(FILE) problem on DragonFly BSD — Yukihiro Matsumoto <matz@...> 2005/09/12

まつもと ゆきひろです

[#27025] Re: sizeof(FILE) problem on DragonFly BSD — Takahiro Kambe <taca@...> 2005/09/12

In message <1126489480.743964.31599.nullmailer@x31.priv.netlab.jp>

[#27027] Re: sizeof(FILE) problem on DragonFly BSD — Takahiro Kambe <taca@...> 2005/09/12

In message <20050912.104954.92585084.taca@back-street.net>

[#27029] Re: sizeof(FILE) problem on DragonFly BSD — Yukihiro Matsumoto <matz@...> 2005/09/12

まつもと ゆきひろです

[#27035] Re: sizeof(FILE) problem on DragonFly BSD — "U.Nakamura" <usa@...> 2005/09/12

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

[#27036] Re: sizeof(FILE) problem on DragonFly BSD — Yukihiro Matsumoto <matz@...> 2005/09/12

まつもと ゆきひろです

[#27079] ruby-1.8.3 status for release (Re: Re: sizeof(FILE) problem on DragonFly BSD) — Masayoshi Takahashi <maki@...> 2005/09/15

高橋征義です。

[#27081] Re: ruby-1.8.3 status for release (Re: Re: sizeof(FILE) problem on DragonFly BSD) — Yukihiro Matsumoto <matz@...> 2005/09/15

まつもと ゆきひろです

[#27082] Re: ruby-1.8.3 status for release — Masayoshi Takahashi <maki@...> 2005/09/15

高橋征義です。

[#27083] Re: ruby-1.8.3 status for release — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/15

山本です。

[#27099] Re: ruby-1.8.3 status for release — Hidetoshi NAGAI <nagai@...> 2005/09/15

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

[#27531] ruby/tk installation without tcl/tk (for 1.8.4) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/10/26

山本です。

[#27619] Re: ruby/tk installation without tcl/tk (for 1.8.4) — Hidetoshi NAGAI <nagai@...> 2005/11/02

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

[#27139] ruby-1.8.3 status for release — Masayoshi Takahashi <maki@...>

高橋征義です。

66 messages 2005/09/18
[#27193] Re: ruby-1.8.3 status for release — TAKAHASHI Masayoshi <maki@...> 2005/09/20

高橋征義です。

[#27251] 脆弱性レポート翻訳者募集 — Yukihiro Matsumoto <matz@...>

まつもと ゆきひろです

13 messages 2005/09/21

[#27321] RubyGemsとOS platformとの関係 — Daigo Moriwaki <techml@...>

こんにちは、森脇です。

42 messages 2005/09/26
[#27327] Re: RubyGemsとOS platformとの関係 — nobuyoshi nakada <nobuyoshi.nakada@...> 2005/09/27

なかだです。

[#27330] Re: RubyGemsとOS platformとの関係 — Yukihiro Matsumoto <matz@...> 2005/09/27

まつもと ゆきひろです

[#27337] Re: RubyGems と OS platform との関係 — NISHIO Mizuho <jurader@...> 2005/09/27

西尾瑞穂 と言います。

[#27343] Re: RubyGems と OS platform との関係 — Yukihiro Matsumoto <matz@...> 2005/09/28

まつもと ゆきひろです

[#27347] Re: RubyGems と OS platform との関係 — Tanaka Akira <akr@...17n.org> 2005/09/28

In article <1127872084.608903.6359.nullmailer@x31.priv.netlab.jp>,

[#27348] Re: RubyGems と OS platform との関係 — Yukihiro Matsumoto <matz@...> 2005/09/28

まつもと ゆきひろです

[#27359] Re: RubyGems と OS platform との関係 — Daigo Moriwaki <techml@...> 2005/09/28

森脇です。

[#27364] Re: RubyGems と OS platform との関係 — akira yamada / やまだあきら <akira@...> 2005/09/30

Daigo Moriwaki wrote:

[#27365] Re: RubyGems と OS platform との関係 — Tanaka Akira <akr@...17n.org> 2005/09/30

In article <433CC31E.20802@ruby-lang.org>,

[#27367] Re: RubyGems と OS platform との関係 — akira yamada / やまだあきら <akira@...> 2005/09/30

Tanaka Akira wrote:

[#27369] Re: RubyGems と OS platform との関係 — Tanaka Akira <akr@...17n.org> 2005/10/01

In article <433D4CED.9030005@ruby-lang.org>,

[ruby-dev:27302] warning: 'cdecl' attribute directive ignored

From: Kazuhiro NISHIYAMA <zn@...>
Date: 2005-09-22 20:36:11 UTC
List: ruby-dev #27302
西山和広です。

Mac OS Xでmakeすると

cfunc.c:280: warning: 'cdecl' attribute directive ignored
cfunc.c:439: warning: 'stdcall' attribute directive ignored

というwarningが大量にでますが、以下のようなパッチでどうでしょうか?

gsub!(/\bDECL_FUNC\(([^,]+,[^,]+,[^,]+),\s*stdcall\)/) { "DECL_FUNC_STDCALL(#$1)" }
gsub!(/\bDECL_FUNC\(([^,]+,[^,]+,[^,]+),\s*cdecl\)/) { "DECL_FUNC_CDECL(#$1)" }
でマクロ呼び出しを置き換えて、マクロ定義部分を適当に
書き換えてみた状態です。


ruby 1.9.0 (2005-09-22) [i686-linux]で
ext/dl/test/のtest_all.rbが
32 tests, 71 assertions, 0 failures, 0 errors
になって通るのは確認しています。

このテストは他のテストと同じようにtestの下に移動した方が
良いのではないでしょうか?


Index: cfunc.c
===================================================================
RCS file: /src/ruby/ext/dl/cfunc.c,v
retrieving revision 1.4
diff -u -p -r1.4 cfunc.c
--- cfunc.c	4 Mar 2005 06:47:39 -0000	1.4
+++ cfunc.c	22 Sep 2005 20:29:38 -0000
@@ -223,10 +223,12 @@ rb_dlcfunc_inspect(VALUE self)
 }
 
 #if defined(__GNUC__)
-# define DECL_FUNC(f,ret,args,calltype)  ret (__attribute__((calltype)) *f)(args)
+# define DECL_FUNC_CDECL(f,ret,args)  ret (*FUNC_CDECL(f))(args)
+# define DECL_FUNC_STDCALL(f,ret,args)  ret (*FUNC_STDCALL(f))(args)
 /* # define DECL_FUNC(f,ret,args,calltype)  ret (*f)(args) */
 #elif defined(_MSC_VER) || defined(__BORLANDC__)
-# define DECL_FUNC(f,ret,args,calltype)  ret (__##calltype *f)(args)
+# define DECL_FUNC_CDECL(f,ret,args)  ret (__cdecl *f)(args)
+# define DECL_FUNC_STDCALL(f,ret,args)  ret (__stdcall *f)(args)
 #else
 # error "unsupported compiler."
 #endif
@@ -273,7 +275,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 	switch( cfunc->type ){
 	case DLTYPE_VOID:
 #define CASE(n) case n: { \
-            DECL_FUNC(f,void,DLSTACK_PROTO##n,cdecl) = cfunc->ptr; \
+            DECL_FUNC_CDECL(f,void,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    f(DLSTACK_ARGS##n(stack)); \
 	    result = Qnil; \
 }
@@ -282,7 +284,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 	    break;
 	case DLTYPE_VOIDP:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,void*,DLSTACK_PROTO##n,cdecl) = cfunc->ptr; \
+	    DECL_FUNC_CDECL(f,void*,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    void * ret; \
 	    ret = f(DLSTACK_ARGS##n(stack)); \
 	    result = PTR2NUM(ret); \
@@ -292,7 +294,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 	    break;
 	case DLTYPE_CHAR:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,char,DLSTACK_PROTO##n,cdecl) = cfunc->ptr; \
+	    DECL_FUNC_CDECL(f,char,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    char ret; \
 	    ret = f(DLSTACK_ARGS##n(stack)); \
 	    result = CHR2FIX(ret); \
@@ -302,7 +304,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 	    break;
 	case DLTYPE_SHORT:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,short,DLSTACK_PROTO##n,cdecl) = cfunc->ptr; \
+	    DECL_FUNC_CDECL(f,short,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    short ret; \
 	    ret = f(DLSTACK_ARGS##n(stack)); \
 	    result = INT2NUM((int)ret); \
@@ -312,7 +314,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 	    break;
 	case DLTYPE_INT:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,int,DLSTACK_PROTO##n,cdecl) = cfunc->ptr; \
+	    DECL_FUNC_CDECL(f,int,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    int ret; \
 	    ret = f(DLSTACK_ARGS##n(stack)); \
 	    result = INT2NUM(ret); \
@@ -322,7 +324,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 	    break;
 	case DLTYPE_LONG:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,long,DLSTACK_PROTO##n,cdecl) = cfunc->ptr; \
+	    DECL_FUNC_CDECL(f,long,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    long ret; \
 	    ret = f(DLSTACK_ARGS##n(stack)); \
 	    result = LONG2NUM(ret); \
@@ -333,7 +335,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #if HAVE_LONG_LONG  /* used in ruby.h */
 	case DLTYPE_LONG_LONG:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,LONG_LONG,DLSTACK_PROTO,cdecl) = cfunc->ptr; \
+	    DECL_FUNC_CDECL(f,LONG_LONG,DLSTACK_PROTO) = cfunc->ptr; \
 	    LONG_LONG ret; \
 	    ret = f(DLSTACK_ARGS(stack)); \
 	    result = LL2NUM(ret); \
@@ -344,7 +346,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #endif
 	case DLTYPE_FLOAT:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,float,DLSTACK_PROTO,cdecl) = cfunc->ptr; \
+	    DECL_FUNC_CDECL(f,float,DLSTACK_PROTO) = cfunc->ptr; \
 	    float ret; \
 	    ret = f(DLSTACK_ARGS(stack)); \
 	    result = rb_float_new(ret); \
@@ -354,7 +356,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 	    break;
 	case DLTYPE_DOUBLE:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,double,DLSTACK_PROTO,cdecl) = cfunc->ptr; \
+	    DECL_FUNC_CDECL(f,double,DLSTACK_PROTO) = cfunc->ptr; \
 	    double ret; \
 	    ret = f(DLSTACK_ARGS(stack)); \
 	    result = rb_float_new(ret); \
@@ -371,7 +373,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 	switch( cfunc->type ){
 	case DLTYPE_VOID:
 #define CASE(n) case n: { \
-            DECL_FUNC(f,void,DLSTACK_PROTO##n,stdcall) = cfunc->ptr; \
+            DECL_FUNC_STDCALL(f,void,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    f(DLSTACK_ARGS##n(stack)); \
 	    result = Qnil; \
 }
@@ -380,7 +382,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 	    break;
 	case DLTYPE_VOIDP:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,void*,DLSTACK_PROTO##n,stdcall) = cfunc->ptr; \
+	    DECL_FUNC_STDCALL(f,void*,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    void * ret; \
 	    ret = f(DLSTACK_ARGS##n(stack)); \
 	    result = PTR2NUM(ret); \
@@ -390,7 +392,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 	    break;
 	case DLTYPE_CHAR:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,char,DLSTACK_PROTO##n,stdcall) = cfunc->ptr; \
+	    DECL_FUNC_STDCALL(f,char,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    char ret; \
 	    ret = f(DLSTACK_ARGS##n(stack)); \
 	    result = CHR2FIX(ret); \
@@ -400,7 +402,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 	    break;
 	case DLTYPE_SHORT:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,short,DLSTACK_PROTO##n,stdcall) = cfunc->ptr; \
+	    DECL_FUNC_STDCALL(f,short,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    short ret; \
 	    ret = f(DLSTACK_ARGS##n(stack)); \
 	    result = INT2NUM((int)ret); \
@@ -410,7 +412,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 	    break;
 	case DLTYPE_INT:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,int,DLSTACK_PROTO##n,stdcall) = cfunc->ptr; \
+	    DECL_FUNC_STDCALL(f,int,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    int ret; \
 	    ret = f(DLSTACK_ARGS##n(stack)); \
 	    result = INT2NUM(ret); \
@@ -420,7 +422,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 	    break;
 	case DLTYPE_LONG:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,long,DLSTACK_PROTO##n,stdcall) = cfunc->ptr; \
+	    DECL_FUNC_STDCALL(f,long,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    long ret; \
 	    ret = f(DLSTACK_ARGS##n(stack)); \
 	    result = LONG2NUM(ret); \
@@ -431,7 +433,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #if HAVE_LONG_LONG  /* used in ruby.h */
 	case DLTYPE_LONG_LONG:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,LONG_LONG,DLSTACK_PROTO,stdcall) = cfunc->ptr; \
+	    DECL_FUNC_STDCALL(f,LONG_LONG,DLSTACK_PROTO) = cfunc->ptr; \
 	    LONG_LONG ret; \
 	    ret = f(DLSTACK_ARGS(stack)); \
 	    result = LL2NUM(ret); \
@@ -442,7 +444,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #endif
 	case DLTYPE_FLOAT:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,float,DLSTACK_PROTO,stdcall) = cfunc->ptr; \
+	    DECL_FUNC_STDCALL(f,float,DLSTACK_PROTO) = cfunc->ptr; \
 	    float ret; \
 	    ret = f(DLSTACK_ARGS(stack)); \
 	    result = rb_float_new(ret); \
@@ -452,7 +454,7 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 	    break;
 	case DLTYPE_DOUBLE:
 #define CASE(n) case n: { \
-	    DECL_FUNC(f,double,DLSTACK_PROTO,stdcall) = cfunc->ptr; \
+	    DECL_FUNC_STDCALL(f,double,DLSTACK_PROTO) = cfunc->ptr; \
 	    double ret; \
 	    ret = f(DLSTACK_ARGS(stack)); \
 	    result = rb_float_new(ret); \



-- 
|ZnZ(ゼット エヌ ゼット)
|西山和広(Kazuhiro NISHIYAMA)

In This Thread

Prev Next