Commit f1d8a31e authored by Steve Wills's avatar Steve Wills

Don't check the patchlevel for version compat, things shouldn't break across patchlevels

parent e2f62725
......@@ -392,11 +392,10 @@ Init_bdb(void)
rb_raise(rb_eNameError, "module already defined");
}
version = rb_tainted_str_new2(db_version(&major, &minor, &patch));
if (major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR
|| patch != DB_VERSION_PATCH) {
rb_raise(rb_eNotImpError, "\nBDB needs compatible versions of libdb & db.h\n\tyou have db.h version %d.%d.%d and libdb version %d.%d.%d\n",
DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
major, minor, patch);
if (major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR) {
rb_raise(rb_eNotImpError, "\nBDB needs compatible versions of libdb & db.h\n\tyou have db.h version %d.%d and libdb version %d.%d\n",
DB_VERSION_MAJOR, DB_VERSION_MINOR,
major, minor);
}
bdb_mMarshal = rb_const_get(rb_cObject, rb_intern("Marshal"));
bdb_id_current_db = rb_intern("__bdb_current_db__");
......@@ -415,7 +414,6 @@ Init_bdb(void)
rb_define_const(bdb_mDb, "VERSION", version);
rb_define_const(bdb_mDb, "VERSION_MAJOR", INT2FIX(major));
rb_define_const(bdb_mDb, "VERSION_MINOR", INT2FIX(minor));
rb_define_const(bdb_mDb, "VERSION_PATCH", INT2FIX(patch));
rb_define_const(bdb_mDb, "VERSION_NUMBER", INT2NUM(BDB_VERSION));
#if HAVE_CONST_DB_BTREE
rb_define_const(bdb_mDb, "BTREE", INT2FIX(DB_BTREE));
......
......@@ -2316,7 +2316,7 @@ extern "C" {
void Init_bdbxml()
{
int major, minor, patch;
int major, minor;
VALUE version;
#ifdef BDB_LINK_OBJ
extern void Init_bdb();
......@@ -2339,19 +2339,16 @@ extern "C" {
xb_mDb = rb_const_get(rb_cObject, rb_intern("BDB"));
major = NUM2INT(rb_const_get(xb_mDb, rb_intern("VERSION_MAJOR")));
minor = NUM2INT(rb_const_get(xb_mDb, rb_intern("VERSION_MINOR")));
patch = NUM2INT(rb_const_get(xb_mDb, rb_intern("VERSION_PATCH")));
if (major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR
|| patch != DB_VERSION_PATCH) {
rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of BDB\n\tyou have BDB::XML version %d.%d.%d and BDB version %d.%d.%d\n",
DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
major, minor, patch);
if (major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR) {
rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of BDB\n\tyou have BDB::XML version %d.%d and BDB version %d.%d\n",
DB_VERSION_MAJOR, DB_VERSION_MINOR,
major, minor);
}
version = rb_tainted_str_new2(dbxml_version(&major, &minor, &patch));
if (major != DBXML_VERSION_MAJOR || minor != DBXML_VERSION_MINOR
|| patch != DBXML_VERSION_PATCH) {
rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of DbXml\n\tyou have DbXml.hpp version %d.%d.%d and libdbxml version %d.%d.%d\n",
DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
major, minor, patch);
version = rb_tainted_str_new2(dbxml_version(&major, &minor));
if (major != DBXML_VERSION_MAJOR || minor != DBXML_VERSION_MINOR) {
rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of DbXml\n\tyou have DbXml.hpp version %d.%d and libdbxml version %d.%d\n",
DB_VERSION_MAJOR, DB_VERSION_MINOR,
major, minor);
}
xb_eFatal = rb_const_get(xb_mDb, rb_intern("Fatal"));
......@@ -2374,7 +2371,6 @@ extern "C" {
rb_define_const(xb_mXML, "VERSION", version);
rb_define_const(xb_mXML, "VERSION_MAJOR", INT2FIX(major));
rb_define_const(xb_mXML, "VERSION_MINOR", INT2FIX(minor));
rb_define_const(xb_mXML, "VERSION_PATCH", INT2FIX(patch));
#ifdef DBXML_CHKSUM_SHA1
rb_define_const(xb_mXML, "CHKSUM_SHA1", INT2NUM(DBXML_CHKSUM_SHA1));
#endif
......
......@@ -5510,7 +5510,7 @@ extern "C" {
void Init_bdbxml()
{
int major, minor, patch;
int major, minor;
VALUE version;
#ifdef BDB_LINK_OBJ
extern void Init_bdb();
......@@ -5535,19 +5535,16 @@ extern "C" {
xb_mDb = rb_const_get(rb_cObject, rb_intern("BDB"));
major = NUM2INT(rb_const_get(xb_mDb, rb_intern("VERSION_MAJOR")));
minor = NUM2INT(rb_const_get(xb_mDb, rb_intern("VERSION_MINOR")));
patch = NUM2INT(rb_const_get(xb_mDb, rb_intern("VERSION_PATCH")));
if (major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR
|| patch != DB_VERSION_PATCH) {
rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of BDB\n\tyou have BDB::XML version %d.%d.%d and BDB version %d.%d.%d\n",
DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
major, minor, patch);
if (major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR) {
rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of BDB\n\tyou have BDB::XML version %d.%d and BDB version %d.%d\n",
DB_VERSION_MAJOR, DB_VERSION_MINOR,
major, minor);
}
version = rb_tainted_str_new2(dbxml_version(&major, &minor, &patch));
if (major != DBXML_VERSION_MAJOR || minor != DBXML_VERSION_MINOR
|| patch != DBXML_VERSION_PATCH) {
rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of DbXml\n\tyou have DbXml.hpp version %d.%d.%d and libdbxml version %d.%d.%d\n",
DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
major, minor, patch);
version = rb_tainted_str_new2(dbxml_version(&major, &minor));
if (major != DBXML_VERSION_MAJOR || minor != DBXML_VERSION_MINOR) {
rb_raise(rb_eNotImpError, "\nBDB::XML needs compatible versions of DbXml\n\tyou have DbXml.hpp version %d.%d and libdbxml version %d.%d\n",
DB_VERSION_MAJOR, DB_VERSION_MINOR,
major, minor);
}
xb_mObs = rb_const_get(rb_cObject, rb_intern("ObjectSpace"));
......@@ -5604,7 +5601,6 @@ extern "C" {
rb_define_const(xb_mXML, "VERSION", version);
rb_define_const(xb_mXML, "VERSION_MAJOR", INT2FIX(major));
rb_define_const(xb_mXML, "VERSION_MINOR", INT2FIX(minor));
rb_define_const(xb_mXML, "VERSION_PATCH", INT2FIX(patch));
#if HAVE_DBXML_CONST_DBXML_ADOPT_DBENV
rb_define_const(xb_mXML, "ADOPT_DBENV", INT2NUM(DBXML_ADOPT_DBENV));
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment