guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SIN_LEN and SIN_LEN6 in libguile/socket.c


From: Michael Tuexen
Subject: SIN_LEN and SIN_LEN6 in libguile/socket.c
Date: Tue, 24 Aug 2004 22:16:08 +0200

Dear all,

the sin_len and sin_len6 field is not available on all platforms. Therefore
the code setting these fields is #ifdefed. But there are not tests in
the configure scripts to test for these fields and depending on that
defining SIN_LEN or SIN_LEN6 or not.

I think something like

AC_MSG_CHECKING(for sin_len)
AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
                #include <sys/types.h>
                #endif
                #include <netinet/in.h>],
               [struct sockaddr_in x; x.sin_len = 0;],
[AC_DEFINE(HAVE_SIN_LEN, 1 [Define this if your IPv4 has sin_len in sockaddr_in struct.])
                AC_MSG_RESULT(yes)],
               [AC_MSG_RESULT(no)])

AC_MSG_CHECKING(for sin6_len)
AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
                #include <sys/types.h>
                #endif
                #include <netinet/in.h>],
               [struct sockaddr_in6 x; x.sin6_len = 0;],
[AC_DEFINE(HAVE_SIN6_LEN, 1, [Define this if your IPv6 has sin6_len in sockaddr_in6 struct.])
                AC_MSG_RESULT(yes)],
               [AC_MSG_RESULT(no)])

should be added to configure.in and SIN_LEN/SIN_LEN6 should be changed to HAVE_SIN_LEN/HAVE_SIN6_LEN
to be consistent with other names.

Best regards
Michael





reply via email to

[Prev in Thread] Current Thread [Next in Thread]