* SIN_LEN and SIN_LEN6 in libguile/socket.c
@ 2004-08-24 20:16 Michael Tuexen
2004-08-25 0:39 ` Kevin Ryde
0 siblings, 1 reply; 4+ messages in thread
From: Michael Tuexen @ 2004-08-24 20:16 UTC (permalink / raw)
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
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: SIN_LEN and SIN_LEN6 in libguile/socket.c
2004-08-24 20:16 SIN_LEN and SIN_LEN6 in libguile/socket.c Michael Tuexen
@ 2004-08-25 0:39 ` Kevin Ryde
2004-08-25 9:40 ` Michael Tuexen
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Ryde @ 2004-08-25 0:39 UTC (permalink / raw)
Cc: guile-devel
Michael Tuexen <Michael.Tuexen@lurchi.franken.de> writes:
>
> 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.
That's a bug, but apparently not harmful on a gnu system (glibc
doesn't seem to have that field).
> AC_MSG_CHECKING(for sin_len)
> AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
> ...
AC_CHECK_MEMBER?
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: SIN_LEN and SIN_LEN6 in libguile/socket.c
2004-08-25 0:39 ` Kevin Ryde
@ 2004-08-25 9:40 ` Michael Tuexen
2004-08-27 1:11 ` Kevin Ryde
0 siblings, 1 reply; 4+ messages in thread
From: Michael Tuexen @ 2004-08-25 9:40 UTC (permalink / raw)
Cc: guile-devel
Hi Kevin,
see my comments below.
Best regards
Michael
On Aug 25, 2004, at 2:39 AM, Kevin Ryde wrote:
> Michael Tuexen <Michael.Tuexen@lurchi.franken.de> writes:
>>
>> 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.
>
> That's a bug, but apparently not harmful on a gnu system (glibc
> doesn't seem to have that field).
>
These fields are available on *BSD systems...
>> AC_MSG_CHECKING(for sin_len)
>> AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
>> ...
>
> AC_CHECK_MEMBER?
AC_CHECK_MEMBER(struct sockaddr_in.sin_len,
AC_DEFINE(HAVE_SIN_LEN, 1, [Define this if your IPv4
has sin_len in sockaddr_in struct.]),,
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <netinet/in.h>])
and
AC_CHECK_MEMBER(struct sockaddr_in6.sin6_len,
AC_DEFINE(HAVE_SIN6_LEN, 1, [Define this if your IPv6
has sin6_len in sockaddr_in6 struct.]),,
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <netinet/in.h>])
do the same job. So you can use whatever you want. I just did not know
about AC_CHECK_MEMBER...
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: SIN_LEN and SIN_LEN6 in libguile/socket.c
2004-08-25 9:40 ` Michael Tuexen
@ 2004-08-27 1:11 ` Kevin Ryde
0 siblings, 0 replies; 4+ messages in thread
From: Kevin Ryde @ 2004-08-27 1:11 UTC (permalink / raw)
Cc: guile-devel
Michael Tuexen <Michael.Tuexen@lurchi.franken.de> writes:
>
> These fields are available on *BSD systems...
Beaut. I added some likely code. Please try it.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-08-27 1:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-24 20:16 SIN_LEN and SIN_LEN6 in libguile/socket.c Michael Tuexen
2004-08-25 0:39 ` Kevin Ryde
2004-08-25 9:40 ` Michael Tuexen
2004-08-27 1:11 ` Kevin Ryde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).