sys_socket tests: Improve checks for socklen_t and sa_family_t.

2024-07-23 Thread Collin Funk
Another longstanding part of the sys/socket.h specification: * The header shall define the socklen_t type, which is an integer type of width of at least 32 bits; see APPLICATION USAGE. * The header shall define the sa_family_t unsigned integer type. On mingw I see

RE: Missing socklen_t defintion on Windows 11 ARM

2023-05-09 Thread Yann Bourdeau
nks again. -Message d'origine- De : Bruno Haible Envoyé : 9 mai 2023 16:24 À : Yann Bourdeau Cc : bug-gett...@gnu.org; bug-gnulib@gnu.org Objet : Re: Missing socklen_t defintion on Windows 11 ARM [CCing bug-gnulib because that's where socklen.m4 comes from] Hi, Yann Bourdeau wr

Re: Missing socklen_t defintion on Windows 11 ARM

2023-05-09 Thread Bruno Haible
t; The error occurs while compile libtextstyle: > ... > > checking for socklen_t... no > checking for socklen_t equivalent... configure: error: Cannot find a type to > use in place of socklen_t > configure: error: ./configure failed for libtextstyle > > I

Re: socklen_t data type

2020-06-29 Thread Eli Zaretskii
> From: Bruno Haible > Cc: Eli Zaretskii , Keith Marshall > , Rahul Das > Date: Tue, 30 Jun 2020 03:07:39 +0200 > > >makes available a type, socklen_t, which is an > > unsigned opaque integral type of length of at least 32 bits. > > The page you c

Re: socklen_t data type

2020-06-29 Thread Bruno Haible
B_defined_socklen_t > typedef int socklen_t; > # define GNULIB_defined_socklen_t 1 > # endif > > # endif > > This unconditionally defines socklen_t on MS-Windows systems as a > signed int data type. Why is this unconditional? Earlier, it was unconditiona

socklen_t data type

2020-06-29 Thread Eli Zaretskii
Gnulib's sys/socket.h has this: # if @HAVE_WINSOCK2_H@ /* Include headers needed by the emulation code. */ # include # include # if !GNULIB_defined_socklen_t typedef int socklen_t; # define GNULIB_defined_socklen_t 1 # endif # endif This unconditionally de

Re: conflicting types for 'socklen_t' | MinGW

2020-04-19 Thread Bruno Haible
> In file included from ../../../../src/gdb-9.1/gnulib/import/sys_socket.c:3: > ./sys/socket.h:533:13: error: conflicting types for 'socklen_t' > 533 | typedef int socklen_t; > |^ This may be related to <https://savannah.gnu.org/bugs/?57725>. Bruno

Re: socklen_t on HP/UX

2008-05-20 Thread Bob Proulx
Dustin J. Mitchell wrote: > As you probably know, on HP/UX, accept, getpeername, et al. take (.., > int *addrlen), not (.., socklen_t *addrlen) unless _XOPEN_SOURCE and > _XOPEN_SOURCE_EXTENDED are defined. However, if these macros are not > defined, socklen_t is still defined. The

socklen_t on HP/UX

2008-05-20 Thread Dustin J. Mitchell
As you probably know, on HP/UX, accept, getpeername, et al. take (.., int *addrlen), not (.., socklen_t *addrlen) unless _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED are defined. However, if these macros are not defined, socklen_t is still defined. This means that the test in socklen.m4 doesn't

socklen_t (was: Re: inet_ntop fix for mingw32)

2006-01-19 Thread Simon Josefsson
e; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -dnl From Albert Chin. +dnl From Albert Chin, Windows fixes from Simon Josefsson. dnl Check for socklen_t: historically on BSD it i

Re: socklen_t

2005-12-02 Thread Paul Eggert
Simon Josefsson <[EMAIL PROTECTED]> writes: > I think you could commit your patch to CVS meanwhile. OK, I've done that, in both gnulib and coreutils. ___ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib

Re: socklen_t

2005-12-01 Thread Simon Josefsson
Paul Eggert <[EMAIL PROTECTED]> writes: > Simon Josefsson <[EMAIL PROTECTED]> writes: > >> Thanks for doing this! I will test this shortly. > > You're welcome. I have installed the file in GNUTLS and GNU SASL. I haven't done any testing yet, but if any problem appear I'll report them. I think

Re: socklen_t

2005-12-01 Thread Ben Pfaff
Paul Eggert <[EMAIL PROTECTED]> writes: > You're welcome. One thing I forgot to mention: the old m4/socklen.m4 > code is obviously incorrect because of the stray parenthesis in this > line: > > #endif) > > That parenthesis is copied into the C header used for testing. > > GCC doesn't mind, but ot

Re: socklen_t

2005-12-01 Thread Paul Eggert
Simon Josefsson <[EMAIL PROTECTED]> writes: > Thanks for doing this! I will test this shortly. You're welcome. One thing I forgot to mention: the old m4/socklen.m4 code is obviously incorrect because of the stray parenthesis in this line: #endif) That parenthesis is copied into the C header u

Re: socklen_t

2005-12-01 Thread Simon Josefsson
Paul Eggert <[EMAIL PROTECTED]> writes: > Albert Chin <[EMAIL PROTECTED]> writes: > >> Ok, paperwork is complete. I don't have time to submit a patch. Can >> someone else do so? > > OK, everybody, how about this patch? I haven't tested it; all I've > done is combined everybody's comments. Notabl

Re: socklen_t

2005-11-22 Thread Paul Eggert
dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -dnl From Simon Josefsson. +dnl From Albert Chin. -AC_DEFUN([gl_SOCKLEN_T], -[ - AC_CHECK_HEADERS_ONCE(sys/types.h sys/socket.h) - AC_CHECK_TYPE([soc

Re: socklen_t

2005-11-20 Thread Albert Chin
> > > No. I'd like to see a liberal license with this though. Curl is under > > > a very liberal license. We'd like to see other programs use this macro > > > for detecting socklen_t as well (lftp has adopted a derivative of it > > > and KDE I think h

Re: socklen_t

2005-09-12 Thread Stepan Kasal
(or the obsolete AC_TRY_*) is not safe; it skips the cleanup of that macro. Something like this is better: ... ],[ socklen_t_equiv="$t" ]) done test -z "$socklen_t_equiv" && break done if -z "$sockle

Re: socklen_t

2005-09-08 Thread Simon Josefsson
Bruno Haible <[EMAIL PROTECTED]> writes: > Simon Josefsson wrote: >> Can I install this? Albert Chin proposed a better M4 test, but the >> legal procedure will take time, and I'm already using my version in a >> few projects. When the legal problems has been fixed, we can change >> it to use the

Re: [bug-gnulib] Re: socklen_t

2005-09-08 Thread Bruno Haible
Simon Josefsson wrote: > Can I install this? Albert Chin proposed a better M4 test, but the > legal procedure will take time, and I'm already using my version in a > few projects. When the legal problems has been fixed, we can change > it to use the new macro and test that. What do you think? A

Re: socklen_t

2005-09-08 Thread Simon Josefsson
* socklen.m4: New file. > > Index: modules/socklen > === > RCS file: modules/socklen > diff -N modules/socklen > --- /dev/null 1 Jan 1970 00:00:00 - > +++ modules/socklen 31 Aug 2005 14:12:39 - > @@ -0,0 +1,20 @@ > +Description: > +Declare socklen_t in confi

Re: socklen_t

2005-09-02 Thread Simon Josefsson
Albert Chin <[EMAIL PROTECTED]> writes: >> This is what M4 macros in gnulib generally use, is it ok? >> >> dnl Copyright (C) 2005 Free Software Foundation, Inc. >> dnl This file is free software; the Free Software Foundation >> dnl gives unlimited permission to copy and/or distribute it, >> dnl w

Re: socklen_t

2005-09-02 Thread Albert Chin
ated the following macro for curl. It's been tested on the > >> > following systems: > >> > >> Has the copyright been assigned to the FSF? > > > > No. I'd like to see a liberal license with this though. Curl is under > > a very liberal

Re: socklen_t

2005-09-02 Thread Simon Josefsson
>> >> Has the copyright been assigned to the FSF? > > No. I'd like to see a liberal license with this though. Curl is under > a very liberal license. We'd like to see other programs use this macro > for detecting socklen_t as well (lftp has adopted a derivative

Re: socklen_t

2005-09-02 Thread Gary V. Vaughan
to see a liberal license with this though. Curl is under a very liberal license. We'd like to see other programs use this macro for detecting socklen_t as well (lftp has adopted a derivative of it and KDE I think has). According to rms it is perfectly fine (preferable in fact!) to distribute

Re: socklen_t

2005-09-01 Thread Albert Chin
x27;d like to see a liberal license with this though. Curl is under a very liberal license. We'd like to see other programs use this macro for detecting socklen_t as well (lftp has adopted a derivative of it and KDE I think has). > > dnl Check for socklen_t: historically on BSD it is an i

Re: socklen_t

2005-09-01 Thread Simon Josefsson
Bruno Haible <[EMAIL PROTECTED]> writes: > Simon Josefsson wrote: >> A bit weird approach of checking for a compatible type, perhaps, but >> if it works, then I'm all for it. Bruno, what do you think? > > It's the standard way of determining a function's prototype. At first sight, > it would be p

Re: [bug-gnulib] Re: socklen_t

2005-09-01 Thread Bruno Haible
Simon Josefsson wrote: > A bit weird approach of checking for a compatible type, perhaps, but > if it works, then I'm all for it. Bruno, what do you think? It's the standard way of determining a function's prototype. At first sight, it would be possible to use a single loop instead of a double lo

Re: socklen_t

2005-09-01 Thread Simon Josefsson
Albert Chin <[EMAIL PROTECTED]> writes: > We created the following macro for curl. It's been tested on the > following systems: Has the copyright been assigned to the FSF? > dnl Check for socklen_t: historically on BSD it is an int, and in > dnl POSIX 1g it is a ty

Re: socklen_t

2005-09-01 Thread Simon Josefsson
onflict in that case. The goal should > be that > #include "config.h" > #include > #include > defines socklen_t. > > Like we do with EILSEQ: There are some systems which define it in > but not in . So we needed to somehow transport the definition from &g

Re: [bug-gnulib] Re: socklen_t

2005-09-01 Thread Bruno Haible
PARC > Tru64 UNIX 4.0D, 5.1 > ... > int getpeername (int, $arg2 *, $t *); Thanks a lot! Simon and I had completely overlooked that 'socklen_t' is not only a by-value parameter (as in bind(), connect()), but also a by-reference para

Re: socklen_t

2005-09-01 Thread Bruno Haible
Simon Josefsson wrote: > POSIX says both sys/socket.h and netdb.h should declare > socklen_t, I was thinking of the case where a system doesn't have > sys/socket.h but has netdb.h. Yes, this is the case that can cause trouble. Some very old systems fall in this category. > Do yo

Re: socklen_t

2005-09-01 Thread Simon Josefsson
Bruno Haible <[EMAIL PROTECTED]> writes: > Normally and should be sufficient to get > socklen_t. Which are the systems where it needs ? I don't know; POSIX says both sys/socket.h and netdb.h should declare socklen_t, I was thinking of the case where a system doesn't hav

Re: socklen_t

2005-09-01 Thread Albert Chin
On Wed, Aug 31, 2005 at 04:18:20PM +0200, Simon Josefsson wrote: > +AC_DEFUN([gl_SOCKLEN_T], > +[ > + AC_CHECK_HEADERS_ONCE(sys/types.h sys/socket.h netdb.h) > + AC_CHECK_TYPE([socklen_t],, [AC_DEFINE([socklen_t], [int], > + [Map `socklen_t' to `i

Re: [bug-gnulib] socklen_t

2005-08-31 Thread Bruno Haible
Normally and should be sufficient to get socklen_t. Which are the systems where it needs ? Bruno ___ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib

socklen_t

2005-08-31 Thread Simon Josefsson
ile: modules/socklen diff -N modules/socklen --- /dev/null 1 Jan 1970 00:00:00 - +++ modules/socklen 31 Aug 2005 14:12:39 - @@ -0,0 +1,20 @@ +Description: +Declare socklen_t in config.h if the system doesn't have it. + +Files: +m4/socklen.m4 + +Depends-on: + +configure.