[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Upgrade to db 4.1

From: Justin Erenkrantz <jerenkrantz_at_apache.org>
Date: 2002-10-16 20:27:02 CEST

--On Wednesday, October 16, 2002 11:10 AM -0700 Zack Weinberg
<zack@codesourcery.com> wrote:

> Can't you wrap things up in a compatibility header file? Like this:
>
># define BDB_VERSION (DB_VERSION_MAJOR * 1000 + DB_VERSION_MINOR)
>
># if BDB_VERSION > 4001
># define BDB_OPEN_ARGS(db, cr) \
> db, NULL, #db, (cr ? (DB_CREAT | DB_EXCL) : 0) | DB_AUTO_COMMIT,
> 0666
># else
># define BDB_OPEN_ARGS(db, cr) \
> db, #db, (cr ? (DB_CREAT | DB_EXCL) : 0), 0666
># endif

Well, some of the open calls do have their own transaction.
Therefore, any such macro would have to realize when a NULL txn is
passed that you have to then pass in DB_AUTO_COMMIT as well.

# if BDB_VERSION > 4001
# define BDB_OPEN_ARGS(db, txn, cr) \
  db, txn, #db, (cr ? (DB_CREAT | DB_EXCL) : 0) | \
  (txn ? 0 : DB_AUTO_COMMIT), 0666
# else
# define BDB_OPEN_ARGS(db, txn, cr) \
    db, #db, (cr ? (DB_CREAT | DB_EXCL) : 0), 0666
# endif

This scores really low on my beauty meter. -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 16 20:27:33 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.