Add conditions to resolve BDB 4.6 compatibility issues.
authoralex <alex@alex-VirtualBox.(none)>
Sat, 24 Aug 2013 14:02:30 +0000 (18:02 +0400)
committeralex <alex@alex-VirtualBox.(none)>
Sat, 24 Aug 2013 14:02:30 +0000 (18:02 +0400)
Successfully compiled and works with BDB 4.6.

src/db.cpp

index dcd3b81..a277508 100644 (file)
@@ -94,7 +94,9 @@ bool CDBEnv::Open(boost::filesystem::path pathEnv_)
     dbenv.set_errfile(fopen(pathErrorFile.string().c_str(), "a")); /// debug
     dbenv.set_flags(DB_AUTO_COMMIT, 1);
     dbenv.set_flags(DB_TXN_WRITE_NOSYNC, 1);
+#ifdef DB_LOG_AUTO_REMOVE
     dbenv.log_set_config(DB_LOG_AUTO_REMOVE, 1);
+#endif
     int ret = dbenv.open(strPath.c_str(),
                      DB_CREATE     |
                      DB_INIT_LOCK  |
@@ -153,7 +155,9 @@ void CDBEnv::MakeMock()
     dbenv.set_lk_max_locks(10000);
     dbenv.set_lk_max_objects(10000);
     dbenv.set_flags(DB_AUTO_COMMIT, 1);
+#ifdef DB_LOG_IN_MEMORY
     dbenv.log_set_config(DB_LOG_IN_MEMORY, 1);
+#endif
     int ret = dbenv.open(NULL,
                      DB_CREATE     |
                      DB_INIT_LOCK  |