define DB_VERSION_FULL to simplify version checks

This commit is contained in:
Howard Chu 2004-10-16 21:59:58 +00:00
parent 1d0e99858a
commit 84ce549016
3 changed files with 7 additions and 6 deletions

View File

@ -23,6 +23,8 @@
LDAP_BEGIN_DECL
#define DB_VERSION_FULL ((DB_VERSION_MAJOR << 24) | (DB_VERSION_MINOR << 16) | DB_VERSION_PATCH)
#define BDB_SUBENTRIES 1
#define DN_BASE_PREFIX SLAP_INDEX_EQUALITY_PREFIX
@ -227,7 +229,7 @@ struct bdb_op_info {
#define XLOCK_ID_FREE(env, locker) (env)->lock_id_free(env, locker)
/* BDB 4.1.17 adds txn arg to db->open */
#if DB_VERSION_MINOR > 1 || DB_VERSION_PATCH >= 17
#if DB_VERSION_FULL >= 0x04010011
#undef DB_OPEN
#define DB_OPEN(db, file, name, type, flags, mode) \
(db)->open(db, NULL, file, name, type, (flags)|DB_AUTO_COMMIT, mode)

View File

@ -438,7 +438,7 @@ bdb_idl_fetch_key(
*
* configure now requires Berkeley DB 4.1.
*/
#if (DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR == 0)
#if DB_VERSION_FULL < 0x04010000
# define BDB_ENOUGH 5
#else
# define BDB_ENOUGH 1

View File

@ -580,7 +580,7 @@ bdb_initialize(
bi->bi_controls = controls;
{ /* version check */
int major, minor, patch;
int major, minor, patch, ver;
char *version = db_version( &major, &minor, &patch );
#ifdef HAVE_EBCDIC
char v2[1024];
@ -594,9 +594,8 @@ bdb_initialize(
version = v2;
#endif
if( major != DB_VERSION_MAJOR ||
minor != DB_VERSION_MINOR ||
patch < DB_VERSION_PATCH )
ver = (major << 24) | (minor << 16) | patch;
if( ver < DB_VERSION_FULL )
{
Debug( LDAP_DEBUG_ANY,
"bdb_initialize: BDB library version mismatch:"