summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2006-01-24 10:02:02 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2006-01-24 10:02:02 (GMT)
commit88f669a757402eb7cb513ef80ea1137089f810ac (patch)
treeaef3b96586ff9aceb1a792395905b9d89ab1595f /Modules
parenta3b5e99d8d105db0f9b7103900ef501049475e46 (diff)
downloadcpython-88f669a757402eb7cb513ef80ea1137089f810ac.zip
cpython-88f669a757402eb7cb513ef80ea1137089f810ac.tar.gz
cpython-88f669a757402eb7cb513ef80ea1137089f810ac.tar.bz2
backport of commit 42169
adds support for compiling against BerkeleyDB 4.4.x
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_bsddb.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c
index ab10e76..0ef797c 100644
--- a/Modules/_bsddb.c
+++ b/Modules/_bsddb.c
@@ -97,7 +97,7 @@
#error "eek! DBVER can't handle minor versions > 9"
#endif
-#define PY_BSDDB_VERSION "4.3.0"
+#define PY_BSDDB_VERSION "4.3.0.1"
static char *rcs_id = "$Id$";
@@ -4099,8 +4099,13 @@ DBEnv_lock_stat(DBEnvObject* self, PyObject* args)
#endif
MAKE_ENTRY(nrequests);
MAKE_ENTRY(nreleases);
- MAKE_ENTRY(nnowaits);
+#if (DBVER < 44)
+ MAKE_ENTRY(nnowaits); /* these were renamed in 4.4 */
MAKE_ENTRY(nconflicts);
+#else
+ MAKE_ENTRY(lock_nowait);
+ MAKE_ENTRY(lock_wait);
+#endif
MAKE_ENTRY(ndeadlocks);
MAKE_ENTRY(regsize);
MAKE_ENTRY(region_wait);
@@ -4936,7 +4941,11 @@ DL_EXPORT(void) init_bsddb(void)
ADD_INT(d, DB_LOCK_IREAD);
ADD_INT(d, DB_LOCK_IWR);
#if (DBVER >= 33)
+#if (DBVER < 44)
ADD_INT(d, DB_LOCK_DIRTY);
+#else
+ ADD_INT(d, DB_LOCK_READ_UNCOMMITTED); /* renamed in 4.4 */
+#endif
ADD_INT(d, DB_LOCK_WWRITE);
#endif
@@ -5038,6 +5047,11 @@ DL_EXPORT(void) init_bsddb(void)
ADD_INT(d, DB_MULTIPLE_KEY);
#endif
+#if (DBVER >= 44)
+ ADD_INT(d, DB_READ_UNCOMMITTED); /* replaces DB_DIRTY_READ in 4.4 */
+ ADD_INT(d, DB_READ_COMMITTED);
+#endif
+
#if (DBVER >= 33)
ADD_INT(d, DB_DONOTINDEX);
#endif