summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--gc.c4
-rw-r--r--ruby.h17
3 files changed, 19 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index a1490772337..517493c2c31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Jun 26 23:41:41 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
+
+ * ruby.h: add cast for ANSI style.
+
+ * gc.c (rb_data_object_alloc): use RUBY_DATA_FUNC.
+
Sat Jun 24 14:36:29 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
* config*.dj, configure.bat, top.sed: move to djgpp/.
diff --git a/gc.c b/gc.c
index 7964d0df947..8257143f9c0 100644
--- a/gc.c
+++ b/gc.c
@@ -299,8 +299,8 @@ VALUE
rb_data_object_alloc(klass, datap, dmark, dfree)
VALUE klass;
void *datap;
- void (*dfree)();
- void (*dmark)();
+ RUBY_DATA_FUNC dmark;
+ RUBY_DATA_FUNC dfree;
{
NEWOBJ(data, struct RData);
OBJSETUP(data, klass, T_DATA);
diff --git a/ruby.h b/ruby.h
index 40d128086eb..8751cc1a709 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) {\