Hi,

> upstream ruby removed file version.h . But we already have lots of fixes
> based on string RUBY_VERSION_CODE, so it's easier to recreate this
> version.h for ruby1.9 package. This patch fix this bug.
> 
> It also fix another bug introduced by ruby1.9 upstream changes.

Basically, we should not use RUBY_VERSION_CODE.
So I think that an approach likes the following patch is better.

diff -ruN bdb-0.6.2.orig/src/bdb.h bdb-0.6.2/src/bdb.h
--- bdb-0.6.2.orig/src/bdb.h    2007-07-29 01:52:43.000000000 +0900
+++ bdb-0.6.2/src/bdb.h 2007-08-30 15:04:28.000000000 +0900
@@ -1,5 +1,7 @@
 #include <ruby.h>
+#ifdef HAVE_VERSION_H
 #include <version.h>
+#endif
 #include <rubysig.h>
 #include <rubyio.h>

diff -ruN bdb-0.6.2.orig/src/common.c bdb-0.6.2/src/common.c
--- bdb-0.6.2.orig/src/common.c 2007-07-28 19:42:08.000000000 +0900
+++ bdb-0.6.2/src/common.c      2007-08-30 15:20:57.000000000 +0900
@@ -3877,7 +3877,11 @@
     char *file, *database;
     VALUE flagv = Qnil, iov = Qnil;
     int flags = 0;
+#if HAVE_TYPE_OPENFILE
     OpenFile *fptr;
+#else
+    rb_io_t *fptr;
+#endif
     FILE *io = NULL;

     rb_secure(4);
diff -ruN bdb-0.6.2.orig/src/extconf.rb bdb-0.6.2/src/extconf.rb
--- bdb-0.6.2.orig/src/extconf.rb       2007-07-25 18:40:04.000000000 +0900
+++ bdb-0.6.2/src/extconf.rb    2007-08-30 15:18:58.000000000 +0900
@@ -82,6 +82,9 @@
    have_func(f)
 end

+have_header("version.h")
+have_type("OpenFile", ["ruby.h", "rubyio.h"])
+
 ["insert", "values_at"].each do |f|
    print "checking for Array##{f}... "
    if [].respond_to?(f)

Thank you.
-- 
ay



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to