aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2005-03-04 23:50:45 +0000
committerKen Raeburn <raeburn@mit.edu>2005-03-04 23:50:45 +0000
commit39c4fe7e342e6da5599adcbe91d10d18afd3a863 (patch)
tree41c6bcc599ead8120b19af14457addc6f237ac13
parent837b787f59adbf4f92fff364a5bfc6979a038686 (diff)
downloadkrb5-39c4fe7e342e6da5599adcbe91d10d18afd3a863.zip
krb5-39c4fe7e342e6da5599adcbe91d10d18afd3a863.tar.gz
krb5-39c4fe7e342e6da5599adcbe91d10d18afd3a863.tar.bz2
hpux10 has gmtime_r with wrong return type, breaking asn.1 encoder
The hpux10 gmtime_r returns int (0 means success), whereas the POSIX gmtime_r returns a pointer (NULL means failure). * configure.in: Check return type of gmtime_r, and define GMTIME_R_RETURNS_INT if it returns int. If the return type can't be determined, pretend the function isn't there. ticket: new status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17117 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/include/ChangeLog6
-rw-r--r--src/include/configure.in23
2 files changed, 29 insertions, 0 deletions
diff --git a/src/include/ChangeLog b/src/include/ChangeLog
index d4c0cde..b1de45f 100644
--- a/src/include/ChangeLog
+++ b/src/include/ChangeLog
@@ -1,3 +1,9 @@
+2005-03-04 Ken Raeburn <raeburn@mit.edu>
+
+ * configure.in: Check return type of gmtime_r, and define
+ GMTIME_R_RETURNS_INT if it returns int. If the return type can't
+ be determined, pretend the function isn't there.
+
2005-02-08 Ken Raeburn <raeburn@mit.edu>
* k5-platform.h (PROGRAM_EXITING) [__GNUC__ && !_WIN32 &&
diff --git a/src/include/configure.in b/src/include/configure.in
index d3ded13..721865b 100644
--- a/src/include/configure.in
+++ b/src/include/configure.in
@@ -98,6 +98,29 @@ if test "$ac_cv_func_getpwuid_r" = yes; then
fi
fi
+if test "$ac_cv_func_gmtime_r" = yes; then
+ AC_MSG_CHECKING([whether gmtime_r returns int])
+ AC_CACHE_VAL(krb5_cv_gmtime_r_returns_int,
+ [AC_TRY_COMPILE([#include <time.h>
+ extern int gmtime_r ();], [1;], return_int=yes, return_int=no)
+ AC_TRY_COMPILE([#include <time.h>
+ extern struct tm *gmtime_r ();], [1;], return_ptr=yes, return_ptr=no)
+ case $return_int/$return_ptr in
+ yes/no) krb5_cv_gmtime_r_returns_int=yes ;;
+ no/yes) krb5_cv_gmtime_r_returns_int=no ;;
+ *) # Can't figure it out, punt the function.
+ ac_cv_func_gmtime_r=no ;;
+ esac])
+ if test "$ac_cv_func_gmtime_r" = no; then
+ AC_MSG_RESULT(unknown -- ignoring gmtime_r)
+ else
+ AC_MSG_RESULT($krb5_cv_gmtime_r_returns_int)
+ if test "$krb5_cv_gmtime_r_returns_int" = yes; then
+ AC_DEFINE(GMTIME_R_RETURNS_INT,1,[Define if gmtime_r returns int instead of struct tm pointer, as on old HP-UX systems.])
+ fi
+ fi
+fi
+
AC_CHECK_FUNC(getservbyname_r,[
ac_cv_func_getservbyname_r=yes
if test "$ac_cv_func_getservbyname_r" = yes; then