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

Re: svn commit: r11871 - in trunk/subversion/libsvn_fs_base: . bdb

From: Branko ─îibej <brane_at_xbc.nu>
Date: 2004-11-12 22:14:36 CET

cmpilato@tigris.org wrote:

>+/* In BDB 4.3, "buffer too small" errors come back with
>+ DB_BUFFER_SMALL (instead of ENOMEM, which is now fatal). */
>+#if (DB_VERSION_MAJOR > 4) \
>+ || (DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR >= 3)
>+#define SVN_BDB_DB_BUFFER_SMALL DB_BUFFER_SMALL
>+#else
>+#define SVN_BDB_DB_BUFFER_SMALL ENOMEM
>+#endif
>
>
#ifndef DB_BUFFER_SMALL
#define SVN_BDB_BUFFER_SMALL ENOMEM
#else
#define SVN_BDB_BUFFER_SMALL DB_BUFFER_SMALL
#endif
  

That's what other bits of that file do, so let's be consistent. Or you
could even

#ifndef DB_NUFFER_SMALL
#define DB_BUFFER_SMALL ENOMEM
#endif
  

This checking of the version number just confuses things. Unfortunately
it's necessary for SVN_BDB_OPEN_PARAMS, because they went and changed
the signature of a function and that's something no amount of macro
magic can fix without looking at the version number...

> /* BDB error callback. See bdb_errcall_baton_t in fs.h for more info. */
> static void
>-bdb_error_gatherer (const char *char_baton, char *msg)
>+#if (DB_VERSION_MAJOR > 4) \
>+ || (DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR >= 3)
>+bdb_error_gatherer (const DB_ENV *dbenv, const char *baton, const char *msg)
>+#else
>+bdb_error_gatherer (const char *baton, char *msg)
>+#endif
>
>
I'd do this in bdb_compat.h myself, along the lines of
SVN_BDB_OPEN_PARAMS. Put all the #ifdef cruft in that header, to keep
the rest of the code moderately readable.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Nov 12 22:14:45 2004

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