Testsuite: perl version oddity
[exim.git] / src / src / hintsdb.h
index 22ba13cadc9c6921c6e8534caf666154b0e26863..ed1b5566d5ad29d6414487fe8590796d2f68657a 100644 (file)
@@ -2,9 +2,10 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2018 */
 /* Copyright (c) The Exim Maintainers 2020 - 2022 */
+/* Copyright (c) University of Cambridge 1995 - 2018 */
 /* See the file NOTICE for conditions of use and distribution. */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 
 /* This header file contains macro definitions so that a variety of DBM
 libraries can be used by Exim. Nigel Metheringham provided the original set for
@@ -23,6 +24,10 @@ utilities as well as the main Exim binary. */
 
 #if defined(USE_TDB)
 
+# if defined(USE_DB) || defined(USE_GDBM)
+#  error USE_TDB conflict with alternate definition
+# endif
+
 /* ************************* tdb interface ************************ */
 /*XXX https://manpages.org/tdb/3 mentions concurrent writes.
 Could we lose the file lock? */
@@ -156,6 +161,10 @@ d->dptr = NULL;
 
 #elif defined USE_DB
 
+# if defined(USE_TDB) || defined(USE_GDBM)
+#  error USE_DB conflict with alternate definition
+# endif
+
 # include <db.h>
 
 /* 1.x did no locking
@@ -203,7 +212,11 @@ at DB release 4.3. */
 
 static inline void
 dbfn_bdb_error_callback(const DB_ENV * dbenv, const char * pfx, const char * msg)
-{ log_write(0, LOG_MAIN, "Berkeley DB error: %s", msg); }
+{
+#ifndef MACRO_PREDEF 
+log_write(0, LOG_MAIN, "Berkeley DB error: %s", msg);
+#endif
+}
 
 
 
@@ -477,6 +490,10 @@ exim_datum_free(EXIM_DATUM * d)
 #elif defined USE_GDBM
 /*XXX TODO: exim's locfile not needed */
 
+# if defined(USE_TDB) || defined(USE_DB)
+#  error USE_GDBM conflict with alternate definition
+# endif
+
 # include <gdbm.h>
 
 /* Basic DB type */
@@ -604,7 +621,7 @@ static inline void
 exim_datum_free(EXIM_DATUM * d)
 { free(d->dptr); }
 
-/* size limit */
+/* size limit. GDBM is int-max limited, but we want to be less silly */
 
 # define EXIM_DB_RLIMIT        150
 
@@ -616,7 +633,7 @@ exim_datum_free(EXIM_DATUM * d)
 
 
 /* If none of USE_DB, USG_GDBM, or USE_TDB are set, the default is the NDBM
-interface */
+interface (which seems to be a wrapper for GDBM) */
 
 
 /********************* ndbm interface definitions **********************/
@@ -740,7 +757,7 @@ exim_datum_free(EXIM_DATUM * d)
 
 # define EXIM_DB_RLIMIT        150
 
-#endif /* USE_GDBM */
+#endif /* !USE_GDBM */