Skip to content

Commit

Permalink
Merge pull request #3 from swills/master
Browse files Browse the repository at this point in the history
Don't check the patchlevel for version compat, things shouldn't break ac...
  • Loading branch information
knu committed Jan 26, 2016
2 parents e2f6272 + f1d8a31 commit 2a5a2fe
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 34 deletions.
10 changes: 4 additions & 6 deletions ext/bdb/bdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__");
Expand All @@ -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));
Expand Down
24 changes: 10 additions & 14 deletions ext/bdbxml1/bdbxml.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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"));
Expand All @@ -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
Expand Down
24 changes: 10 additions & 14 deletions ext/bdbxml2/bdbxml.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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"));
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2a5a2fe

Please sign in to comment.