summaryrefslogtreecommitdiff
path: root/ruby.h
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-26 15:16:03 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-26 15:16:03 +0000
commit7ea888f520b632a2ecf2d9a184a5871546820720 (patch)
tree02904bfd30d96c83e7f5802565977fabbbf04b40 /ruby.h
parent977986667692d72b887a88facf77d0206c08ad15 (diff)
2000-06-27
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.h')
-rw-r--r--ruby.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/ruby.h b/ruby.h
index 40d1280..8751cc1 100644
--- a/ruby.h
+++ b/ruby.h
@@ -290,16 +290,21 @@ struct RData {
#define DATA_PTR(dta) (RDATA(dta)->data)
+/*
#define RUBY_DATA_FUNC(func) ((void (*)_((void*)))func)
-VALUE rb_data_object_alloc _((VALUE,void*,void (*) _((void*)),void (*) _((void*))));
+*/
+typedef void (*RUBY_DATA_FUNC) _((void*));
+
+VALUE rb_data_object_alloc _((VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC));
+
+#define Data_Wrap_Struct(klass,mark,free,sval) (\
+ rb_data_object_alloc(klass,sval,(RUBY_DATA_FUNC)mark,(RUBY_DATA_FUNC)free)\
+)
+
#define Data_Make_Struct(klass,type,mark,free,sval) (\
sval = ALLOC(type),\
memset(sval, 0, sizeof(type)),\
- rb_data_object_alloc(klass,sval,mark,free)\
-)
-
-#define Data_Wrap_Struct(klass,mark,free,sval) (\
- rb_data_object_alloc(klass,sval,mark,free)\
+ Data_Wrap_Struct(klass,mark,free,sval)\
)
#define Data_Get_Struct(obj,type,sval) {\