Codebase list cyrus-imapd / db64755
Add support for Berkeley DB version >= 5.x Ondřej Surý 13 years ago
2 changed file(s) with 48 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 --- a/lib/cyrusdb_berkeley.c
1 +++ b/lib/cyrusdb_berkeley.c
2 @@ -108,7 +108,7 @@ static void db_panic(DB_ENV *dbenv __att
3 exit(EC_TEMPFAIL);
4 }
5
6 -#if (DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR >= 3)
7 +#if ((DB_VERSION_MAJOR > 4) || ((DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR >= 3)))
8 static void db_err(const DB_ENV *dbenv __attribute__((unused)),
9 const char *db_prfx, const char *buffer)
10 #else
11 @@ -163,7 +163,7 @@ static int init(const char *dbdir, int m
12 #endif
13 }
14
15 -#if (DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR >= 3)
16 +#if ((DB_VERSION_MAJOR > 4) || ((DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR >= 3)))
17 dbenv->set_msgcall(dbenv, db_msg);
18 #endif
19 dbenv->set_errcall(dbenv, db_err);
20 @@ -281,7 +281,7 @@ static int mysync(void)
21
22 assert(dbinit);
23
24 -#if !(DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1)
25 +#if !((DB_VERSION_MAJOR > 4) || ((DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR >= 1)))
26 do {
27 #endif
28 #if (DB_VERSION_MAJOR > 3) || ((DB_VERSION_MAJOR == 3) && (DB_VERSION_MINOR > 0))
29 @@ -289,7 +289,7 @@ static int mysync(void)
30 #else
31 r = txn_checkpoint(dbenv, 0, 0);
32 #endif
33 -#if !(DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1)
34 +#if !((DB_VERSION_MAJOR > 4) || ((DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR >= 1)))
35 } while (r == DB_INCOMPLETE); /* Never returned by BDB 4.1 */
36 #endif
37 if (r) {
38 @@ -412,7 +412,7 @@ static int myopen(const char *fname, DBT
39 /* xxx set comparator! */
40 if (flags & CYRUSDB_MBOXSORT) db->set_bt_compare(db, mbox_compar);
41
42 -#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1
43 +#if ((DB_VERSION_MAJOR > 4) || ((DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR >= 1)))
44 r = (db->open)(db, NULL, fname, NULL, type, dbflags | DB_AUTO_COMMIT, 0664);
45 #else
46 r = (db->open)(db, fname, NULL, type, dbflags, 0664);
2727 82-fix_manpage_errors.patch
2828 cyrus-imapd-2.4.2-902-accept-invalid-from-header.patch
2929 cyrus-imapd-2.4.2-903-normalize-authorization-id.patch
30 83-db5.1_macros.patch