From d0b3651906aa943423e430a61437a42f7dd39422 Mon Sep 17 00:00:00 2001 From: H_Konishi Date: Tue, 11 Jun 2002 01:27:48 +0000 Subject: new platform [bccwin32] merged. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/dl/depend | 8 ++++---- ext/dl/dl.c | 2 +- ext/dl/extconf.rb | 15 +++++++++++++++ ext/dl/sym.c | 2 +- 4 files changed, 21 insertions(+), 6 deletions(-) (limited to 'ext/dl') 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); -- cgit v1.2.3