summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>1995-07-25 18:42:08 +0000
committerTom Yu <tlyu@mit.edu>1995-07-25 18:42:08 +0000
commitb8d5b0d052ebb2599d45540980c2f92fe38f08d3 (patch)
treea3c25cc3290f1cadf891fce2cc97e3b2387f4152 /src/lib
parent74fc44898b04f79156c25ad4a4f666e37493454d (diff)
downloadkrb5-b8d5b0d052ebb2599d45540980c2f92fe38f08d3.tar.gz
krb5-b8d5b0d052ebb2599d45540980c2f92fe38f08d3.tar.xz
krb5-b8d5b0d052ebb2599d45540980c2f92fe38f08d3.zip
* kdb_dbm.c, t_kdb.c: Add prototype for dbm_error and dbm_clearerr
in case they're not prototyped in the header files. * configure.in: Add test for missing prototypes for dbm_error and dbm_clearerr. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6322 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/kdb/ChangeLog8
-rw-r--r--src/lib/kdb/configure.in34
-rw-r--r--src/lib/kdb/kdb_dbm.c12
-rw-r--r--src/lib/kdb/t_kdb.c12
4 files changed, 66 insertions, 0 deletions
diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog
index 289c2d94fc..fcebad85d7 100644
--- a/src/lib/kdb/ChangeLog
+++ b/src/lib/kdb/ChangeLog
@@ -1,3 +1,11 @@
+Tue Jul 25 14:06:50 1995 Tom Yu <tlyu@lothlorien.MIT.EDU>
+
+ * kdb_dbm.c, t_kdb.c: Add prototype for dbm_error and dbm_clearerr
+ in case they're not prototyped in the header files.
+
+ * configure.in: Add test for missing prototypes for dbm_error and
+ dbm_clearerr.
+
Thu Jul 20 23:59:18 1995 Mark Eichin <eichin@cygnus.com>
* kdb_dbm.c (krb5_dbm_db_create): move dirname, pagname
diff --git a/src/lib/kdb/configure.in b/src/lib/kdb/configure.in
index fce913aa19..4b45a6a1e3 100644
--- a/src/lib/kdb/configure.in
+++ b/src/lib/kdb/configure.in
@@ -18,6 +18,40 @@ else
DBFLAGS=-DBERK_DB_DBM
fi
AC_SUBST(DBFLAGS)dnl
+AC_CHECK_LIB(ndbm,main)
+AC_CHECK_LIB(dbm,main)
+AC_MSG_CHECKING([for missing dbm_error prototype])
+if test "$ac_cv_func_dbm_open" = yes; then
+ AC_EGREP_HEADER([dbm_error], [ndbm.h],
+ AC_MSG_RESULT(no), AC_TRY_LINK(
+[#include <ndbm.h>
+int dbm_error();],
+[dbm_error();], AC_DEFINE([MISSING_ERROR_PROTO])
+AC_MSG_RESULT(yes), AC_MSG_RESULT(no)))
+else
+ AC_EGREP_HEADER([dbm_error], [ndbm.h],
+ AC_MSG_RESULT(no), AC_TRY_LINK(
+[#include <dbm.h>
+int dbm_error();],
+[dbm_error();], AC_DEFINE([MISSING_ERROR_PROTO])
+AC_MSG_RESULT(yes), AC_MSG_RESULT(no)))
+fi
+AC_MSG_CHECKING([for missing dbm_clearerr prototype])
+if test "$ac_cv_func_dbm_open" = yes; then
+ AC_EGREP_HEADER([dbm_error], [ndbm.h],
+ AC_MSG_RESULT(no), AC_TRY_LINK(
+[#include <ndbm.h>
+int dbm_clearerr();],
+[dbm_clearerr();], AC_DEFINE([MISSING_CLEARERR_PROTO])
+AC_MSG_RESULT(yes), AC_MSG_RESULT(no)))
+else
+ AC_EGREP_HEADER([dbm_error], [ndbm.h],
+ AC_MSG_RESULT(no), AC_TRY_LINK(
+[#include <dbm.h>
+int dbm_clearerr();],
+[dbm_clearerr();], AC_DEFINE([MISSING_CLEARERR_PROTO])
+AC_MSG_RESULT(yes), AC_MSG_RESULT(no)))
+fi
dnl
V5_USE_SHARED_LIB
AC_CHECK_FUNCS(srand48 srand srandom umask)
diff --git a/src/lib/kdb/kdb_dbm.c b/src/lib/kdb/kdb_dbm.c
index 4357c54ccf..88ebb55b0e 100644
--- a/src/lib/kdb/kdb_dbm.c
+++ b/src/lib/kdb/kdb_dbm.c
@@ -156,6 +156,18 @@ static kdb5_dispatch_table kdb5_default_dispatch = {
};
#else /* BERK_DB_DBM */
/*
+ * The following prototypes are necessary in case dbm_error and
+ * dbm_clearerr are in the library but not prototyped
+ * (e.g. NetBSD-1.0)
+ */
+#ifdef MISSING_ERROR_PROTO
+int dbm_error PROTOTYPE((DBM *));
+#endif
+#ifdef MISSING_CLEARERR_PROTO
+int dbm_clearerr PROTOTYPE((DBM *));
+#endif
+
+/*
* This module contains all of the code which directly interfaces to
* the underlying representation of the Kerberos database; this
* implementation uses a DBM or NDBM indexed "file" (actually
diff --git a/src/lib/kdb/t_kdb.c b/src/lib/kdb/t_kdb.c
index ae43bab823..1010b65dd3 100644
--- a/src/lib/kdb/t_kdb.c
+++ b/src/lib/kdb/t_kdb.c
@@ -106,6 +106,18 @@ static kdb5_dispatch_table berkeley_dispatch = {
(int (*)()) NULL /* Get Database FD num */
};
+/*
+ * The following prototypes are necessary in case dbm_error and
+ * dbm_clearerr are in the library but not prototyped
+ * (e.g. NetBSD-1.0)
+ */
+#ifdef MISSING_ERROR_PROTO
+int dbm_error PROTOTYPE((DBM *));
+#endif
+#ifdef MISSING_CLEARERR_PROTO
+int dbm_clearerr PROTOTYPE((DBM *));
+#endif
+
static kdb5_dispatch_table dbm_dispatch = {
"Stock [N]DBM Database",
".dir", /* Index file name ext */