summaryrefslogtreecommitdiff
path: root/ext/dl
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dl')
-rw-r--r--ext/dl/depend8
-rw-r--r--ext/dl/dl.c2
-rw-r--r--ext/dl/extconf.rb15
-rw-r--r--ext/dl/sym.c2
4 files changed, 21 insertions, 6 deletions
diff --git a/ext/dl/depend b/ext/dl/depend
index 552c67d0f5..313fac43a7 100644
--- a/ext/dl/depend
+++ b/ext/dl/depend
@@ -6,19 +6,19 @@ LDSHARED_TEST = $(LDSHARED) $(LDFLAGS) test/test.o -o test/libtest.so $(LOCAL_LI
libtest.so: test/libtest.so
test/libtest.so: test/test.o test/libtest.def
- $(RUBY) -rftools -e 'ARGV.each{|d|File.mkpath(File.dirname(d))}' $@
+ $(RUBY) -rftools -e 'ARGV.each do|d|File.mkpath(File.dirname(d))end' $@
$(LDSHARED_TEST:dl.def=test/libtest.def)
test/test.o: $(srcdir)/test/test.c
@$(RUBY) -rftools -e 'File.mkpath(*ARGV)' test
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/test/test.c -o $@
-test:: dl.so libtest.so .force
+test:: dl.so libtest.so force
$(RUBY) -I. -I$(srcdir)/lib $(srcdir)/test/test.rb
-.force:
+force:
-.PHONY: .force test
+.PHONY: force test
allclean: distclean
@rm -f $(CLEANFILES) $(DISTCLEANFILES)
diff --git a/ext/dl/dl.c b/ext/dl/dl.c
index 935ae33e32..dd4f4423b5 100644
--- a/ext/dl/dl.c
+++ b/ext/dl/dl.c
@@ -626,7 +626,7 @@ rb_dl_callback(int argc, VALUE argv[], VALUE self)
rb_assoc_new(INT2NUM(rettype),INT2NUM(entry)),
rb_assoc_new(type,proc));
sprintf(fname, "rb_dl_callback_func_%d_%d", rettype, entry);
- return rb_dlsym_new(rb_dl_callback_table[rettype][entry], fname, STR2CSTR(type));
+ return rb_dlsym_new((void (*)())rb_dl_callback_table[rettype][entry], fname, STR2CSTR(type));
}
static VALUE
diff --git a/ext/dl/extconf.rb b/ext/dl/extconf.rb
index 7b7c48f1a2..46b3c6c87d 100644
--- a/ext/dl/extconf.rb
+++ b/ext/dl/extconf.rb
@@ -176,6 +176,21 @@ $INSTALLFILES = [
["dl.h", "$(archdir)$(target_prefix)", ""],
]
+if /bccwin32/ =~ RUBY_PLATFORM
+ srcdir = $top_srcdir + "/ext/dl/"
+ if !FileTest.exist?( srcdir+"dl.def.org" )
+ File.copy( srcdir+"dl.def", srcdir+"dl.def.org" )
+ open( srcdir+"dl.def.org" ){ |f|
+ open( "dl.def", "w" ) { |g|
+ g.print f.gets
+ while line = f.gets
+ g.print "_", line
+ end
+ }
+ }
+ end
+end
+
create_makefile('dl')
rescue SystemExit
# do nothing
diff --git a/ext/dl/sym.c b/ext/dl/sym.c
index bc51ebe102..3326d6743f 100644
--- a/ext/dl/sym.c
+++ b/ext/dl/sym.c
@@ -140,7 +140,7 @@ rb_dlsym_s_new(int argc, VALUE argv[], VALUE self)
sname = NIL_P(name) ? NULL : StringValuePtr(name);
stype = NIL_P(type) ? NULL : StringValuePtr(type);
- val = rb_dlsym_new(saddr, sname, stype);
+ val = rb_dlsym_new((void (*)())saddr, sname, stype);
if( val != Qnil ){
rb_obj_call_init(val, argc, argv);