e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B
In message “[ruby-dev:28942] FUNC_CDECL/FUNC_STDCALL are not defined?”
on Jul.03,2006 19:53:15, [email protected] wrote:
| 1.8.5-preview1e$B$NOCBj$K3d$j9~$`7A$G?=$7Lu$“$j$^$;$s$,!”$5$-$[$Ie(B
| CVS HEAD e$B$N%3%s%Q%$%k$r;n$_$?$H$3$me(B(VC++ 7.1 Windows 2000SP4)e$B!"e(B
| ext/dl e$B$N%3%s%Q%$%k$Ge(Bcallback.he$B$K4X$7$FBgNL$K%3%s%Q%$%k%(%i!<$,e(B
| e$BH/@8$7$F%S%k%I$K<:GT$7$^$7$?!#e(B
e$B:F8=$7$^$7$?!#e(B
e$B$A$J$_$K!“e(BVC++e$B0J30$G$b!”<j85$Ne(BNetBSDe$B$G$be(B
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
e$B$H$+$K$J$C$F%3%s%Q%$%k$K<:GT$7$^$9!#e(B
chkbuilde$B$Ne(BNetBSD
[email protected]$7$F$k$N$G!“e(Bgcce$B$N%P!<%8%g%s$+$Je(B
e$B$s$+$,1F6A$7$F$=$&$G$O$”$j$^$9$,!#e(B
| ChangeLoge$B$r$_$F$b$3$3?tF|$Ge(B ext/dl e$B$,=$@5$5$l$?5$G[$O$J$$$N$G$9$,!"e(B
[ruby-cvs:17051]e$B$G$9$M!#0l:rF|$NL$L@$K$J$j$^$9!#e(B
| e$B$H$j$"$($:$`$j$d$j$3$l$iFs$D$N%^%/%m$rE,Ev$KDj5A$7$F$d$k$3$H$G%3%s%Q%$%ke(B
| e$B$O$G$-!"e(Bnmake test e$B$bDL$j$^$7$?!#e(B
e$BLZB<$5$s$O$I$&Dj5A$7$^$7$?e(B?
e$B;d$,$d$k$H!“e(BFUNC_e$B$J$s$?$i$rDj5A$9$k$3$H$rHr$1$A$c$C$F$3$s$J$se(B
e$B$K$J$j$=$&$G$9$,!”$+$C$3$o$k$$e(B…
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: { \
@@ -286,3 +286,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -296,3 +296,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -306,3 +306,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -316,3 +316,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -326,3 +326,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -337,3 +337,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -348,3 +348,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -358,3 +358,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -375,3 +375,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -384,3 +384,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -394,3 +394,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -404,3 +404,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -414,3 +414,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -424,3 +424,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -435,3 +435,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -446,3 +446,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
@@ -456,3 +456,3 @@ rb_dlcfunc_call(VALUE self, VALUE ary)
#define CASE(n) case n: { \
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(”, ")}))
{
e$B$=$l$G$O!#e(B