aboutsummaryrefslogtreecommitdiffstats
path: root/ext/dl/dl.h
diff options
context:
space:
mode:
authorttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-11 23:13:34 +0000
committerttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-11 23:13:34 +0000
commit22b07f548866252372cb0b4a705ee9c6daf8807d (patch)
tree421973a24ff7d00018ed9c309df2f8124c9b5a53 /ext/dl/dl.h
parent64db3a3251a1fa03a1c5aade0182b80d95349576 (diff)
downloadruby-22b07f548866252372cb0b4a705ee9c6daf8807d.tar.gz
enable dl's stack emulation for constructing function call.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/dl.h')
-rw-r--r--ext/dl/dl.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/ext/dl/dl.h b/ext/dl/dl.h
index a88e95d66f..ceee8c5384 100644
--- a/ext/dl/dl.h
+++ b/ext/dl/dl.h
@@ -142,8 +142,8 @@
#if defined(USE_INLINE_ASM)
# if defined(__i386__) && defined(__GNUC__)
-# define ASM_START(type)
-# define ASM_END(type)
+# define ASM_START(sym)
+# define ASM_END(sym)
# define ASM_PUSH_C(x) asm volatile ("pushl %0" :: "g" (x));
# define ASM_PUSH_H(x) asm volatile ("pushl %0" :: "g" (x));
# define ASM_PUSH_I(x) asm volatile ("pushl %0" :: "g" (x));
@@ -158,15 +158,16 @@
# else
# error --with-asm is not supported on this machine
# endif
-#else
-# define ASM_START(type)
-# define ASM_END(type)
-# define ASM_PUSH_C(x)
-# define ASM_PUSH_I(x)
-# define ASM_PUSH_L(x)
-# define ASM_PUSH_P(x)
-# define ASM_PUSH_F(x)
-# define ASM_PUSH_D(x)
+#elif defined(USE_DLSTACK)
+# define ASM_START(sym)
+# define ASM_END(sym)
+# define ASM_PUSH_C(x) memcpy(sp,&x,1); sp++;
+# define ASM_PUSH_H(x) memcpy(sp,&x,sizeof(short)); sp++;
+# define ASM_PUSH_I(x) memcpy(sp,&x,sizeof(int)); sp++;
+# define ASM_PUSH_L(x) memcpy(sp,&x,sizeof(long)); sp++;
+# define ASM_PUSH_P(x) memcpy(sp,&x,sizeof(void*)); sp++;
+# define ASM_PUSH_F(x) memcpy(sp,&x,sizeof(float)); sp+=sizeof(float)/sizeof(long);
+# define ASM_PUSH_D(x) memcpy(sp,&x,sizeof(double)); sp+=sizeof(double)/sizeof(long);
#endif
extern VALUE rb_mDL;