[#28942] FUNC_CDECL/FUNC_STDCALL are not defined? — KIMURA Koichi <kimura.koichi@...>

木村です。

24 messages 2006/07/03
[#28943] Re: FUNC_CDECL/FUNC_STDCALL are not defined? — "U.Nakamura" <usa@...> 2006/07/03

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

[#28945] Re: FUNC_CDECL/FUNC_STDCALL are not defined? — Takaaki Tateishi <ttate@...> 2006/07/03

U.Nakamura wrote:

[#28946] Re: FUNC_CDECL/FUNC_STDCALL are not defined? — "U.Nakamura" <usa@...> 2006/07/03

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

[#29006] block wrapper — Tanaka Akira <akr@...>

以前、[ruby-dev:28747] の pp.rb の問題を解決するのに

44 messages 2006/07/10
[#29007] Re: block wrapper — Yukihiro Matsumoto <matz@...> 2006/07/10

まつもと ゆきひろです

[#29008] Re: block wrapper — Tanaka Akira <akr@...> 2006/07/10

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

[#29009] Re: block wrapper — Yukihiro Matsumoto <matz@...> 2006/07/10

まつもと ゆきひろです

[#29010] Re: block wrapper — Tanaka Akira <akr@...> 2006/07/10

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

[#29022] Re: block wrapper — Tanaka Akira <akr@...> 2006/07/12

In article <87psgd8qb2.fsf@fsij.org>,

[#29078] Re: block wrapper — Tanaka Akira <akr@...> 2006/07/19

In article <87r70rdpeg.fsf@fsij.org>,

[#29466] Re: block wrapper — Tanaka Akira <akr@...> 2006/09/04

In article <871wshddvn.fsf@fsij.org>,

[#29584] Re: block wrapper — Tanaka Akira <akr@...> 2006/09/16

In article <87ac5g5a7i.fsf@fsij.org>,

[#29616] Re: block wrapper — Tanaka Akira <akr@...> 2006/09/26

In article <8764foo7s7.fsf@fsij.org>,

[#30777] Re: block wrapper — Tanaka Akira <akr@...> 2007/05/11

In article <87venar27i.fsf@fsij.org>,

[#30778] Re: block wrapper — Yukihiro Matsumoto <matz@...> 2007/05/11

まつもと ゆきひろです

[#30780] Re: block wrapper — Tanaka Akira <akr@...> 2007/05/12

In article <1178883053.645482.13087.nullmailer@x31.netlab.jp>,

[#30781] Re: block wrapper — Yukihiro Matsumoto <matz@...> 2007/05/12

まつもと ゆきひろです

[#30840] Re: block wrapper — Tanaka Akira <akr@...> 2007/05/30

In article <1178978140.846301.8164.nullmailer@x31.netlab.jp>,

[#30843] Re: block wrapper — Yukihiro Matsumoto <matz@...> 2007/05/30

まつもと ゆきひろです

[#30848] Re: block wrapper — SASADA Koichi <ko1@...> 2007/05/31

 ささだです。

[#30850] Re: block wrapper — Yukihiro Matsumoto <matz@...> 2007/05/31

まつもと ゆきひろです

[#30855] Re: block wrapper — Tanaka Akira <akr@...> 2007/05/31

In article <E1HtaMS-00041i-6U@x31>,

[#29013] problem in bignorm — "U.Nakamura" <usa@...>

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

14 messages 2006/07/10
[#29016] Re: problem in bignorm — Yukihiro Matsumoto <matz@...> 2006/07/11

まつもと ゆきひろです

[#29018] Re: problem in bignorm — "U.Nakamura" <usa@...> 2006/07/11

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

[#29019] Re: problem in bignorm — "U.Nakamura" <usa@...> 2006/07/11

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

[#29038] irb completion — Tadayoshi Funaba <tadf@...>

ふなばです。

22 messages 2006/07/17
[#29063] Re: irb completion — keiju@... (石塚圭樹) 2006/07/18

けいじゅ@いしつかです.

[#29064] Re: irb completion — Yukihiro Matsumoto <matz@...> 2006/07/18

まつもと ゆきひろです

[#29070] Re: irb completion — Ryan Davis <ryand-ruby@...> 2006/07/18

[#29093] Re: [ruby-cvs:17195] ruby/test/rss: * object.c (rb_mod_attr): make Module#attr to be an alias to — Tanaka Akira <akr@...>

In article <20060720173258.5D4BAC6781@lithium.ruby-lang.org>,

14 messages 2006/07/20
[#29096] Re: ruby/test/rss: * object.c (rb_mod_attr): make Module#attr to be an alias to — Yukihiro Matsumoto <matz@...> 2006/07/20

まつもと ゆきひろです

[#29097] Re: ruby/test/rss: * object.c (rb_mod_attr): make Module#attr to be an alias to — Tanaka Akira <akr@...> 2006/07/20

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

[#29098] Re: ruby/test/rss: * object.c (rb_mod_attr): make Module#attr to be an alias to — Yukihiro Matsumoto <matz@...> 2006/07/20

まつもと ゆきひろです

[#29099] Re: ruby/test/rss: * object.c (rb_mod_attr): make Module#attr to be an alias to — Tanaka Akira <akr@...> 2006/07/20

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

[#29101] Re: ruby/test/rss: * object.c (rb_mod_attr): make Module#attr to be an alias to — Yukihiro Matsumoto <matz@...> 2006/07/21

まつもと ゆきひろです

[#29148] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — WATANABE Hirofumi <eban@...>

わたなべです。

31 messages 2006/07/27
[#29149] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — "NARUSE, Yui" <naruse@...> 2006/07/27

成瀬です。

[#29151] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — Yukihiro Matsumoto <matz@...> 2006/07/27

まつもと ゆきひろです

[#29152] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — URABE Shyouhei <root@...> 2006/07/27

卜部です

[#29153] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — Yukihiro Matsumoto <matz@...> 2006/07/27

まつもと ゆきひろです

[#29155] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — URABE Shyouhei <root@...> 2006/07/27

卜部です。

[#29157] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — "NARUSE, Yui" <naruse@...> 2006/07/27

成瀬です。

[#29159] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — Yukihiro Matsumoto <matz@...> 2006/07/27

まつもと ゆきひろです

[#29440] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — "NARUSE, Yui" <naruse@...> 2006/09/03

成瀬です

[#29462] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — Yukihiro Matsumoto <matz@...> 2006/09/04

まつもと ゆきひろです

[#29467] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — "NARUSE, Yui" <naruse@...> 2006/09/04

成瀬です。

[#29472] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — Yukihiro Matsumoto <matz@...> 2006/09/04

まつもと ゆきひろです

[#29483] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — "NARUSE, Yui" <naruse@...> 2006/09/05

成瀬です。

[#29488] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — Yukihiro Matsumoto <matz@...> 2006/09/05

まつもと ゆきひろです

[#29494] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — Tadayoshi Funaba <tadf@...> 2006/09/05

ふなばです。

[#29497] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — Yukihiro Matsumoto <matz@...> 2006/09/05

まつもと ゆきひろです

[#29513] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — Tadayoshi Funaba <tadf@...> 2006/09/06

> 郵便局の消印は採用できないんですが、なにが良いと思いますか。

[#29516] Re: [ruby-cvs:17256] ruby, ruby: * time.c (time_to_s): generate RFC822 style date string. — Yukihiro Matsumoto <matz@...> 2006/09/06

まつもと ゆきひろです

[ruby-dev:28943] Re: FUNC_CDECL/FUNC_STDCALL are not defined?

From: "U.Nakamura" <usa@...>
Date: 2006-07-03 12:10:57 UTC
List: ruby-dev #28943
こんにちは、なかむら(う)です。

In message "[ruby-dev:28942] FUNC_CDECL/FUNC_STDCALL are not defined?"
    on Jul.03,2006 19:53:15, <kimura.koichi@canon.co.jp> wrote:
| 1.8.5-preview1の話題に割り込む形で申し訳ありませんが、さきほど
| CVS HEAD のコンパイルを試みたところ(VC++ 7.1 Windows 2000SP4)、
| ext/dl のコンパイルでcallback.hに関して大量にコンパイルエラーが
| 発生してビルドに失敗しました。

再現しました。

ちなみに、VC++以外でも、手元のNetBSDでも

In file included from ../../../current/ext/dl/dl.c:77:
callback.h:9: error: parse error before '{' token
callback.h:12: error: initializer element is not constant
callback.h:12: warning: data definition has no type or storage class

とかになってコンパイルに失敗します。
chkbuildのNetBSD 2.0.1では成功してるので、gccのバージョンかな
んかが影響してそうではありますが。


| ChangeLogをみてもここ数日で ext/dl が修正された気配はないのですが、

[ruby-cvs:17051]ですね。一昨日の未明になります。


| とりあえずむりやりこれら二つのマクロを適当に定義してやることでコンパイル
| はでき、nmake test も通りました。

木村さんはどう定義しました?

私がやると、FUNC_なんたらを定義することを避けちゃってこんなん
になりそうですが、かっこわるい...

Index: ext/dl/cfunc.c
===================================================================
RCS file: /home/cvs/ruby/ext/dl/cfunc.c,v
retrieving revision 1.5
diff -u -1 -p -r1.5 cfunc.c
--- ext/dl/cfunc.c	30 Jun 2006 18:05:34 -0000	1.5
+++ ext/dl/cfunc.c	3 Jul 2006 12:03:23 -0000
@@ -225,8 +225,8 @@ rb_dlcfunc_inspect(VALUE self)
 #if defined(__GNUC__)
-# define DECL_FUNC_CDECL(f,ret,args)  FUNC_CDECL(ret (*f)(args))
-# define DECL_FUNC_STDCALL(f,ret,args)  FUNC_STDCALL(ret (*f)(args))
+# define DECL_PFUNC_CDECL(f,ret,args)  FUNC_CDECL(ret (*f)(args))
+# define DECL_PFUNC_STDCALL(f,ret,args)  FUNC_STDCALL(ret (*f)(args))
 /* # define DECL_FUNC(f,ret,args,calltype)  ret (*f)(args) */
 #elif defined(_MSC_VER) || defined(__BORLANDC__)
-# define DECL_FUNC_CDECL(f,ret,args)  ret (__cdecl *f)(args)
-# define DECL_FUNC_STDCALL(f,ret,args)  ret (__stdcall *f)(args)
+# define DECL_PFUNC_CDECL(f,ret,args)  ret (__cdecl *f)(args)
+# define DECL_PFUNC_STDCALL(f,ret,args)  ret (__stdcall *f)(args)
 #else
@@ -277,3 +277,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-            DECL_FUNC_CDECL(f,void,DLSTACK_PROTO##n) = cfunc->ptr; \
+            DECL_PFUNC_CDECL(f,void,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    f(DLSTACK_ARGS##n(stack)); \
@@ -286,3 +286,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_CDECL(f,void*,DLSTACK_PROTO##n) = cfunc->ptr; \
+	    DECL_PFUNC_CDECL(f,void*,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    void * ret; \
@@ -296,3 +296,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_CDECL(f,char,DLSTACK_PROTO##n) = cfunc->ptr; \
+	    DECL_PFUNC_CDECL(f,char,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    char ret; \
@@ -306,3 +306,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_CDECL(f,short,DLSTACK_PROTO##n) = cfunc->ptr; \
+	    DECL_PFUNC_CDECL(f,short,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    short ret; \
@@ -316,3 +316,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_CDECL(f,int,DLSTACK_PROTO##n) = cfunc->ptr; \
+	    DECL_PFUNC_CDECL(f,int,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    int ret; \
@@ -326,3 +326,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_CDECL(f,long,DLSTACK_PROTO##n) = cfunc->ptr; \
+	    DECL_PFUNC_CDECL(f,long,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    long ret; \
@@ -337,3 +337,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_CDECL(f,LONG_LONG,DLSTACK_PROTO) = cfunc->ptr; \
+	    DECL_PFUNC_CDECL(f,LONG_LONG,DLSTACK_PROTO) = cfunc->ptr; \
 	    LONG_LONG ret; \
@@ -348,3 +348,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_CDECL(f,float,DLSTACK_PROTO) = cfunc->ptr; \
+	    DECL_PFUNC_CDECL(f,float,DLSTACK_PROTO) = cfunc->ptr; \
 	    float ret; \
@@ -358,3 +358,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_CDECL(f,double,DLSTACK_PROTO) = cfunc->ptr; \
+	    DECL_PFUNC_CDECL(f,double,DLSTACK_PROTO) = cfunc->ptr; \
 	    double ret; \
@@ -375,3 +375,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-            DECL_FUNC_STDCALL(f,void,DLSTACK_PROTO##n) = cfunc->ptr; \
+            DECL_PFUNC_STDCALL(f,void,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    f(DLSTACK_ARGS##n(stack)); \
@@ -384,3 +384,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_STDCALL(f,void*,DLSTACK_PROTO##n) = cfunc->ptr; \
+	    DECL_PFUNC_STDCALL(f,void*,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    void * ret; \
@@ -394,3 +394,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_STDCALL(f,char,DLSTACK_PROTO##n) = cfunc->ptr; \
+	    DECL_PFUNC_STDCALL(f,char,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    char ret; \
@@ -404,3 +404,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_STDCALL(f,short,DLSTACK_PROTO##n) = cfunc->ptr; \
+	    DECL_PFUNC_STDCALL(f,short,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    short ret; \
@@ -414,3 +414,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_STDCALL(f,int,DLSTACK_PROTO##n) = cfunc->ptr; \
+	    DECL_PFUNC_STDCALL(f,int,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    int ret; \
@@ -424,3 +424,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_STDCALL(f,long,DLSTACK_PROTO##n) = cfunc->ptr; \
+	    DECL_PFUNC_STDCALL(f,long,DLSTACK_PROTO##n) = cfunc->ptr; \
 	    long ret; \
@@ -435,3 +435,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_STDCALL(f,LONG_LONG,DLSTACK_PROTO) = cfunc->ptr; \
+	    DECL_PFUNC_STDCALL(f,LONG_LONG,DLSTACK_PROTO) = cfunc->ptr; \
 	    LONG_LONG ret; \
@@ -446,3 +446,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_STDCALL(f,float,DLSTACK_PROTO) = cfunc->ptr; \
+	    DECL_PFUNC_STDCALL(f,float,DLSTACK_PROTO) = cfunc->ptr; \
 	    float ret; \
@@ -456,3 +456,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
 #define CASE(n) case n: { \
-	    DECL_FUNC_STDCALL(f,double,DLSTACK_PROTO) = cfunc->ptr; \
+	    DECL_PFUNC_STDCALL(f,double,DLSTACK_PROTO) = cfunc->ptr; \
 	    double ret; \
Index: ext/dl/dl.h
===================================================================
RCS file: /home/cvs/ruby/ext/dl/dl.h,v
retrieving revision 1.13
diff -u -1 -p -r1.13 dl.h
--- ext/dl/dl.h	5 Feb 2005 13:58:08 -0000	1.13
+++ ext/dl/dl.h	3 Jul 2006 12:03:23 -0000
@@ -182,2 +182,13 @@ VALUE rb_dlptr_malloc(long size, freefun
 
+#if defined(__GNUC__)
+# define DECL_FUNC_CDECL(f,ret,args)  FUNC_CDECL(ret f(args))
+# define DECL_FUNC_STDCALL(f,ret,args)  FUNC_STDCALL(ret f(args))
+/* # define DECL_FUNC(f,ret,args,calltype)  ret (*f)(args) */
+#elif defined(_MSC_VER) || defined(__BORLANDC__)
+# 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
+
 #endif
Index: ext/dl/mkcallback.rb
===================================================================
RCS file: /home/cvs/ruby/ext/dl/mkcallback.rb,v
retrieving revision 1.10
diff -u -1 -p -r1.10 mkcallback.rb
--- ext/dl/mkcallback.rb	30 Jun 2006 18:05:34 -0000	1.10
+++ ext/dl/mkcallback.rb	3 Jul 2006 12:03:23 -0000
@@ -113,4 +113,3 @@ for calltype in CALLTYPES
 
-FUNC_#{calltype.upcase}(static #{DLTYPE[ty][:type]}
-#{func_name(ty,argc,n,calltype)}(#{(0...argc).collect{|i| "DLSTACK_TYPE stack" + i.to_s}.join(", ")}))
+DECL_FUNC_#{calltype.upcase}(#{func_name(ty,argc,n,calltype)},static #{DLTYPE[ty][:type]},(#{(0...argc).collect{|i| "DLSTACK_TYPE stack" + i.to_s}.join(", ")}))
 {

それでは。
-- 
U.Nakamura <usa@garbagecollect.jp>



In This Thread