+2001-04-25 Ken Raeburn <raeburn@mit.edu>
+
+ * acconfig.h (HAVE_SOCKLEN_T): Add.
+ (HAS_VOID_TYPE): Delete.
+
2001-04-17 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (unixmac): Target deleted.
handle it on some systems. */
#undef ANSI_STDIO
-#undef HAS_VOID_TYPE
#undef KRB5_NO_PROTOTYPES
#undef KRB5_PROVIDE_PROTOTYPES
#undef KRB5_NO_NESTED_PROTOTYPES
/* Define if struct sockaddr and friends (sockaddr_in etc) have the
sa_len field. */
#undef HAVE_SA_LEN
+/* Define if there is a socklen_t type; if not, size_t is probably
+ what we should use. */
+#undef HAVE_SOCKLEN_T
/* Define if MIT Project Athena default configuration should be used */
#undef KRB5_ATHENA_COMPAT
+2001-04-25 Ken Raeburn <raeburn@mit.edu>
+
+ * k5-int.h (socklen_t) [NEED_SOCKETS] [!HAVE_SOCKLEN_T]: Define as
+ typedef for size_t.
+ (socklen) [NEED_SOCKETS]: Define macro if not already defined.
+ * configure.in: Don't check for support for type "void". Move
+ socklen_t test here from krb5 library.
+
2001-04-13 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (adm_err.h, asn1_err.h, krb5_err.h, kv5m_err.h):
AC_DEFINE(KRB5_NO_NESTED_PROTOTYPES)
fi
dnl
-dnl Check for void type
-dnl
-AC_MSG_CHECKING([void])
-AC_CACHE_VAL(krb5_cv_has_void_type,
-[AC_TRY_COMPILE(
-[void x();], [],
-krb5_cv_has_void_type=yes, krb5_cv_has_void_type=no)])
-AC_MSG_RESULT($krb5_cv_has_void_type)
-if test $krb5_cv_has_void_type = yes; then
-AC_DEFINE(HAS_VOID_TYPE)
-fi
-dnl
dnl Word sizes...
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_SUBST(KRB5_RCTMPDIR)
dnl
dnl
+AC_MSG_CHECKING(for socklen_t)
+AC_CACHE_VAL(krb5_cv_has_type_socklen_t,
+[AC_TRY_COMPILE(
+[#include <sys/types.h>
+#include <sys/socket.h>
+],[sizeof (socklen_t);],
+krb5_cv_has_type_socklen_t=yes,krb5_cv_has_type_socklen_t=no)])
+AC_MSG_RESULT($krb5_cv_has_type_socklen_t)
+if test $krb5_cv_has_type_socklen_t = yes; then
+ AC_DEFINE(HAVE_SOCKLEN_T)
+fi
+dnl
+dnl
AC_ARG_ENABLE([athena],
[ --enable-athena build with MIT Project Athena configuration],
AC_DEFINE(KRB5_ATHENA_COMPAT),)
#ifdef NEED_SOCKETS
#include "port-sockets.h"
+
+/* Either size_t or int or unsigned int is probably right. Under
+ SunOS 4, it looks like int is desired, according to the accept man
+ page. */
+#ifndef HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
+#if !defined (socklen)
+/* size_t socklen (struct sockaddr *) */
+/* Should this return socklen_t instead? */
+# ifdef HAVE_SA_LEN
+# define socklen(X) ((X)->sa_len)
+# else
+# ifdef KRB5_USE_INET6
+# define socklen(X) ((X)->sa_family == AF_INET6 ? sizeof (struct sockaddr_in6) : (X)->sa_family == AF_INET ? sizeof (struct sockaddr_in) : sizeof (struct sockaddr))
+# else
+# define socklen(X) ((X)->sa_family == AF_INET ? sizeof (struct sockaddr_in) : sizeof (struct sockaddr))
+# endif
+# endif
+#endif
+
#else
#ifndef SOCK_DGRAM
struct sockaddr;
+2001-04-25 Ken Raeburn <raeburn@mit.edu>
+
+ * configure.in: Moved test for socklen_t to include directory.
+
2001-03-05 Tom Yu <tlyu@mit.edu>
* configure.in: Check for sys/filio.h for FIONBIO.
AC_TYPE_OFF_T
dnl
dnl
-AC_MSG_CHECKING(for socklen_t)
-AC_CACHE_VAL(krb5_cv_has_type_socklen_t,
-[AC_TRY_COMPILE(
-[#include <sys/types.h>
-#include <sys/socket.h>
-],[sizeof (socklen_t);],
-krb5_cv_has_type_socklen_t=yes,krb5_cv_has_type_socklen_t=no)])
-AC_MSG_RESULT($krb5_cv_has_type_socklen_t)
-if test $krb5_cv_has_type_socklen_t = yes; then
- AC_DEFINE(HAVE_SOCKLEN_T)
-fi
-dnl
-dnl
HAS_ANSI_VOLATILE
AC_HEADER_STDARG
AC_CHECK_HEADERS(unistd.h paths.h regex.h regexp.h regexpr.h fcntl.h memory.h ifaddrs.h sys/filio.h)
+2001-04-25 Ken Raeburn <raeburn@mit.edu>
+
+ * localaddr.c (socklen_t, socklen): Deleted; definitions now in
+ k5-int.h instead.
+
2001-03-31 Ken Raeburn <raeburn@mit.edu>
* t_gifconf.c: New file.
return ret;
}
-#ifndef HAVE_SOCKLEN_T
-typedef size_t socklen_t;
-#endif
-
-static size_t
-socklen (const struct sockaddr *sa)
- /*@*/
-{
-#ifdef HAVE_SA_LEN
- return sa->sa_len;
-#else
- switch (sa->sa_family) {
- case AF_INET:
- return sizeof (struct sockaddr_in);
-#ifdef KRB5_USE_INET6
- case AF_INET6:
- return sizeof (struct sockaddr_in6);
-#endif
- default:
- return sizeof (struct sockaddr);
- }
-#endif
-}
-
/* Return value is errno if internal stuff failed, otherwise zero,
even in the case where a called function terminated the iteration.