summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/extmk.rb.in2
-rw-r--r--ext/marshal/marshal.c12
2 files changed, 9 insertions, 5 deletions
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index f1acef5608..80e2a3c9d1 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -243,7 +243,7 @@ libdir = @libdir@/ruby/@arch@
mfile.printf $objs.join(" ")
mfile.printf "\n"
- dots = if "@INSTALL@" =~ /^\// then "" else "#{$topdir}/" end
+ dots = if "@INSTALL@" =~ /^\// then "" else "#{$topdir}/ext" end
mfile.printf "\
TARGET = %s.%s
diff --git a/ext/marshal/marshal.c b/ext/marshal/marshal.c
index 47cb0fcd2a..a74ecd70eb 100644
--- a/ext/marshal/marshal.c
+++ b/ext/marshal/marshal.c
@@ -620,7 +620,9 @@ r_object(arg)
case TYPE_FLOAT:
{
+#ifndef atof
double atof();
+#endif
char *buf;
r_bytes(buf, arg);
@@ -695,15 +697,17 @@ r_object(arg)
len = r_long(arg);
values = ary_new2(len);
- i = 0;
+ for (i=0; i<len; i++) {
+ ary_push(values, Qnil);
+ }
+ v = struct_alloc(class, values);
+ r_regist(v, arg);
for (i=0; i<len; i++) {
ID slot = r_symbol(arg);
if (RARRAY(mem)->ptr[i] != INT2FIX(slot))
TypeError("struct not compatible");
- ary_push(values, r_object(arg));
+ struct_aset(v, INT2FIX(i), r_object(arg));
}
- v = struct_alloc(class, values);
- st_insert(arg->data, num, v); /* re-regist */
return v;
}
break;