From: Ezra Peisach Date: Fri, 30 Jun 2000 19:34:38 +0000 (+0000) Subject: * pty-int.h: Add getutmpx() prototype if needed X-Git-Tag: krb5-1.3-alpha1~2060 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=52555067459cdac3514d5ae13b8f48db96ef0ad1;p=krb5.git * pty-int.h: Add getutmpx() prototype if needed * configure.in: If getutmpx() exists on the system, test if a prototype is provided by the system headers. This was picked up by gcc -Wall. Under Linux glibc 2.1, the system header file provides a prototype for getutmpx() only if _GNU_SOURCE is defined (GNU extensions). The test offeres a prototype (which matches in this case) - if the prototype conflicts with a system provided one, we do not provide it. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12477 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog index 67af4e7fb..7b7ab0d69 100644 --- a/src/util/pty/ChangeLog +++ b/src/util/pty/ChangeLog @@ -1,3 +1,10 @@ +2000-06-30 Ezra Peisach + + * pty-int.h: Add getutmpx() prototype if needed. + + * configure.in: If getutmpx() exists on the system, test if a + prototype is provided by the system headers. + 2000-06-28 Ezra Peisach * getpty.c (pty_getpty): More conditionalizing variable defintion diff --git a/src/util/pty/configure.in b/src/util/pty/configure.in index 1bf4decb4..28b1b3fe8 100644 --- a/src/util/pty/configure.in +++ b/src/util/pty/configure.in @@ -147,6 +147,28 @@ AC_DEFINE(UT_EXIT_STRUCTURE_DIFFER) fi fi dnl +dnl Test to see if a certain prototype exists in the system header files +dnl If we get a conflict - then we back off. Note: If our prototype matches +dnl exactly, then we will list it and we both win. +if test x$ac_cv_func_getutmpx = xyes; then +AC_CACHE_CHECK([need to provide getutmpx prototype], krb5_cv_decl_getutmpx, +[AC_TRY_COMPILE(dnl +[#include +#ifdef HAVE_UTMP_H +#include +#endif +#ifdef HAVE_UTMPX_H +#include +#endif +extern void getutmpx (const struct utmp *, struct utmpx *); +], +[], krb5_cv_decl_getutmpx=yes, krb5_cv_decl_getutmpx=no)]) + if test $krb5_cv_decl_getutmpx = yes; then + AC_DEFINE(NEED_GETUTMPX_PROTOTYPE) + fi +fi +dnl +dnl ADD_DEF(-DKERBEROS) AC_CONST KRB5_BUILD_LIBRARY_WITH_DEPS diff --git a/src/util/pty/pty-int.h b/src/util/pty/pty-int.h index f2ede6e36..d183cf28f 100644 --- a/src/util/pty/pty-int.h +++ b/src/util/pty/pty-int.h @@ -90,6 +90,10 @@ #define VHANG_LAST #endif +#if defined(NEED_GETUTMPX_PROTOTYPE) +extern void getutmpx (const struct utmp *, struct utmpx *); +#endif + /* Internal functions */ #ifdef __STDC__ long ptyint_void_association(void);