Ben Pfaff wrote: > --- a/lib/unistd.in.h > +++ b/lib/unistd.in.h > @@ -281,8 +281,17 @@ extern int getdtablesize (void); > If the host name is longer than LEN, set errno = EINVAL and return -1. > Return 0 if successful, otherwise set errno and return -1. */ > # if [EMAIL PROTECTED]@ > +# if HAVE_WINSOCK2_H > +# /* Bypass bad prototype for gethostname(). */ > +# include <winsock2.h> > +# undef gethostname > +# define gethostname rpl_gethostname > +# endif > extern int gethostname(char *name, size_t len); > # endif > +#elif @UNISTD_H_HAVE_WINSOCK2_H@ > +# undef gethostname > +# define gethostname > gethostname_used_without_requesting_gnulib_module_gethostname > #elif defined GNULIB_POSIXCHECK > # undef gethostname > # define gethostname(n,l) \
Yes, this looks all right. Only use @UNISTD_H_HAVE_WINSOCK2_H@ instead of HAVE_WINSOCK2_H in line 284 above. Thanks! Bruno