summaryrefslogtreecommitdiff
path: root/ext/dl/cfunc.c
diff options
context:
space:
mode:
authorttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-06 18:07:10 +0000
committerttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-06 18:07:10 +0000
commitdca41072d39248093c84fb29c823c9b06a30724c (patch)
treef6e999222f25bb745bcf0a723069fcefd6aca431 /ext/dl/cfunc.c
parent1f0125e4aafceca63b4ce353dbb58e66c1052bd8 (diff)
Added VC++ support thanks to U.Nakamura's patch. [ruby-dev:25644]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/cfunc.c')
-rw-r--r--ext/dl/cfunc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/dl/cfunc.c b/ext/dl/cfunc.c
index 6dcca5c6db8..2e5a35d2780 100644
--- a/ext/dl/cfunc.c
+++ b/ext/dl/cfunc.c
@@ -225,6 +225,8 @@ rb_dlcfunc_inspect(VALUE self)
#if defined(__GNUC__)
# define DECL_FUNC(f,ret,args,calltype) ret (__attribute__((calltype)) *f)(args)
/* # 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
# error "unsupported compiler."
#endif
@@ -331,7 +333,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(f,LONG_LONG,DLSTACK_PROTO,cdecl) = cfunc->ptr; \
LONG_LONG ret; \
ret = f(DLSTACK_ARGS(stack)); \
result = LL2NUM(ret); \
@@ -429,7 +431,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(f,LONG_LONG,DLSTACK_PROTO,stdcall) = cfunc->ptr; \
LONG_LONG ret; \
ret = f(DLSTACK_ARGS(stack)); \
result = LL2NUM(ret); \