From: Tom Yu Date: Tue, 25 Jul 1995 18:42:08 +0000 (+0000) Subject: * kdb_dbm.c, t_kdb.c: Add prototype for dbm_error and dbm_clearerr X-Git-Tag: krb5-1.0-beta6~1497 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b8d5b0d052ebb2599d45540980c2f92fe38f08d3;p=krb5.git * 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 --- diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog index 289c2d94f..fcebad85d 100644 --- a/src/lib/kdb/ChangeLog +++ b/src/lib/kdb/ChangeLog @@ -1,3 +1,11 @@ +Tue Jul 25 14:06:50 1995 Tom Yu + + * 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 * 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 fce913aa1..4b45a6a1e 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 +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 +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 +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 +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 4357c54cc..88ebb55b0 100644 --- a/src/lib/kdb/kdb_dbm.c +++ b/src/lib/kdb/kdb_dbm.c @@ -155,6 +155,18 @@ static kdb5_dispatch_table kdb5_default_dispatch = { (int (*)()) NULL /* Get DB data FD num */ }; #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 diff --git a/src/lib/kdb/t_kdb.c b/src/lib/kdb/t_kdb.c index ae43bab82..1010b65dd 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 */