File fix_db_pointers.patch of Package global

diff --git a/libdb/db.c b/libdb/db.c
index 5f7b8f3..0000000 100644
--- a/libdb/db.c
+++ b/libdb/db.c
@@ -1,3 +1,4 @@
+#include <stddef.h>
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -81,6 +82,45 @@ static int
 __dberr(void)
 {
 	return (RET_ERROR);
 }
 
+/*
+ * Provide type-specific wrappers returning RET_ERROR to avoid
+ * incompatible function pointer assignments on modern compilers.
+ */
+static int __dberr_del(const struct __db *dbp, const DBT *key, u_int flags)
+{
+    (void)dbp; (void)key; (void)flags;
+    return RET_ERROR;
+}
+
+static int __dberr_fd(const struct __db *dbp)
+{
+    (void)dbp;
+    return RET_ERROR;
+}
+
+static int __dberr_get(const struct __db *dbp, const DBT *key, DBT *data, u_int flags)
+{
+    (void)dbp; (void)key; (void)data; (void)flags;
+    return RET_ERROR;
+}
+
+static int __dberr_put(const struct __db *dbp, DBT *key, const DBT *data, u_int flags)
+{
+    (void)dbp; (void)key; (void)data; (void)flags;
+    return RET_ERROR;
+}
+
+static int __dberr_seq(const struct __db *dbp, DBT *key, DBT *data, u_int flags)
+{
+    (void)dbp; (void)key; (void)data; (void)flags;
+    return RET_ERROR;
+}
+
+static int __dberr_sync(const struct __db *dbp, u_int flags)
+{
+    (void)dbp; (void)flags;
+    return RET_ERROR;
+}
+
 /**
  * __DBPANIC -- Stop.
  *
  *	@param dbp	pointer to the DB structure.
  */
 void
 __dbpanic(dbp)
 	DB *dbp;
 {
 	/* The only thing that can succeed is a close. */
-	dbp->del = (int (*)())__dberr;
-	dbp->fd = (int (*)())__dberr;
-	dbp->get = (int (*)())__dberr;
-	dbp->put = (int (*)())__dberr;
-	dbp->seq = (int (*)())__dberr;
-	dbp->sync = (int (*)())__dberr;
+	dbp->del = __dberr_del;
+	dbp->fd = __dberr_fd;
+	dbp->get = __dberr_get;
+	dbp->put = __dberr_put;
+	dbp->seq = __dberr_seq;
+	dbp->sync = __dberr_sync;
 }
openSUSE Build Service is sponsored by