summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--ext/extmk.rb10
-rw-r--r--lib/mkmf.rb8
-rw-r--r--time.c4
4 files changed, 17 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index a56bee8..447240c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sun Sep 8 21:29:25 2002 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * time.c (time_free): prototype; struct time_object -> void *.
+ avoid GCC warnings.
+
+ * lib/mkmf.rb, ext/extmk.rb ($LINK, $CPP): move to lib/mkmf.rb.
+
Sun Sep 8 19:02:28 2002 NAKAMURA Usaku <usa@ruby-lang.org>
* time.c: prototype; time_free() to avoid VC++ warnings.
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 77757dc..ca46e25 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -32,19 +32,17 @@ $extlist = []
$:.replace ["."]
require 'rbconfig'
-$top_srcdir = Config::CONFIG["srcdir"]
+srcdir = Config::CONFIG["srcdir"]
-$:.replace [$top_srcdir, $top_srcdir+"/lib", "."]
+$:.replace [srcdir, srcdir+"/lib", "."]
require 'mkmf'
require 'find'
require 'ftools'
require 'shellwords'
-$topdir = File.expand_path(".")
-
-$LINK = "#{CONFIG['CC']} #{OUTFLAG}conftest -I#$topdir -I#$top_srcdir #{CFLAGS} %s %s #{CONFIG['LDFLAGS']} %s conftest.c %s %s #{CONFIG['LIBS']}"
-$CPP = "#{CONFIG['CPP']} #{CONFIG['CPPFLAGS']} %s -I#$topdir -I#$top_srcdir #{CFLAGS} %s %s %s conftest.c"
+$topdir = $hdrdir = File.expand_path(".")
+$top_srcdir = srcdir
Object.class_eval do remove_method :create_makefile end
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index a0e01c4..fb2ce78 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -68,7 +68,7 @@ else
STDERR.print "can't find header files for ruby.\n"
exit 1
end
-$topdir = $hdrdir
+$topdir = $top_srcdir = $hdrdir
# $hdrdir.gsub!('/', '\\') if RUBY_PLATFORM =~ /mswin32|bccwin32/
CFLAGS = CONFIG["CFLAGS"]
@@ -89,9 +89,9 @@ else
CPPOUTFILE = '-o conftest.i'
end
-$LINK = "#{CONFIG['CC']} #{OUTFLAG}conftest -I#{$hdrdir} #{CFLAGS} %s %s #{CONFIG['LDFLAGS']} %s conftest.c %s %s #{CONFIG['LIBS']}"
-$CC = "#{CONFIG['CC']} -c #{CONFIG['CPPFLAGS']} %s -I#{$hdrdir} #{CFLAGS} %s %s conftest.c"
-$CPP = "#{CONFIG['CPP']} #{CONFIG['CPPFLAGS']} %s -I#{$hdrdir} #{CFLAGS} %s %s %s conftest.c"
+$LINK = "#{CONFIG['CC']} #{OUTFLAG}conftest -I#{$hdrdir} -I#{$top_srcdir} #{CFLAGS} %s %s #{CONFIG['LDFLAGS']} %s conftest.c %s %s #{CONFIG['LIBS']}"
+$CC = "#{CONFIG['CC']} -c #{CONFIG['CPPFLAGS']} %s -I#{$hdrdir} -I#{$top_srcdir} #{CFLAGS} %s %s conftest.c"
+$CPP = "#{CONFIG['CPP']} #{CONFIG['CPPFLAGS']} %s -I#{$hdrdir} -I#{$top_srcdir} #{CFLAGS} %s %s %s conftest.c"
def rm_f(*files)
targets = []
diff --git a/time.c b/time.c
index ff66acf..01d370e 100644
--- a/time.c
+++ b/time.c
@@ -43,11 +43,11 @@ struct time_object {
#define GetTimeval(obj, tobj) \
Data_Get_Struct(obj, struct time_object, tobj)
-static void time_free _((struct time_object *));
+static void time_free _((void *));
static void
time_free(tobj)
- struct time_object *tobj;
+ void *tobj;
{
if (tobj) free(tobj);
}