[PATCH] building for BerkeleyDB 3.2.9

David Relson relson at osagesoftware.com
Sun Apr 24 17:29:49 CEST 2005


Greetings,

This morning, Boris 'pi' Piwinger, reported (off-list) a build problem
using BerkeleyDB 3.2.9.  It started with a query about this message:

  datastore_db.c: In function `db_do_leafpages':
  datastore_db.c:1060: too few arguments to function
  *** Error code 1

The line in question (line 1060 of datastore_db.c) is:

  ret = BF_DB_STAT(dbp, NULL, &dbstat, 0);

and BF_DB_STAT is a macro defined in datastore_dbcommon.h as

  /* DB->stat interface changed in 4.3 */
  #if DB_AT_LEAST(4,3)
  #define BF_DB_STAT(d, t, s, f) ((d)->stat((d), (t), (s), (f)))
  #else
  #define BF_DB_STAT(d, t, s, f) ((d)->stat((d), (s), (f)))
  #endif

It turns out that in db-3.2.9 db->stat() took 4 arguments, which
changed to 3 in db-3.3 and back to 4 in db-4.3 (though a different 4
than with db-3.2).

The patch (below) fixes the build problem (and lets "make check"
succeed).

Thanks to pi for reporting the problem!

David

#### Begin patch for datastore_dbcommon.h ####

--- datastore_dbcommon.h	20 Dec 2004 02:00:44 -0000	1.2
+++ datastore_dbcommon.h	24 Apr 2005 14:28:44 -0000
@@ -35,10 +35,16 @@
 #endif
 #endif
 
-/* DB->stat interface changed in 4.3 */
+/* DB->stat interface changed in 3.3 and in 4.3 */
+#if DB_AT_MOST(3,2)
+#define BF_DB_STAT(d, t, s, f) ((d)->stat((d), (s), NULL, (f)))
+#endif
+
 #if DB_AT_LEAST(4,3)
 #define BF_DB_STAT(d, t, s, f) ((d)->stat((d), (t), (s), (f)))
-#else
+#endif
+
+#ifndef BF_DB_STAT
 #define BF_DB_STAT(d, t, s, f) ((d)->stat((d), (s), (f)))
 #endif
 




More information about the Bogofilter mailing list