bug-gnulib
[Top][All Lists]
Advanced

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

Re: error compiling gethostname.c on woe32


From: Bruno Haible
Subject: Re: error compiling gethostname.c on woe32
Date: Thu, 1 Oct 2009 01:59:36 +0200
User-agent: KMail/1.9.9

Sam Steingold wrote:
> I think this patch is in order:
> =============================================================
> --- w32sock.h.~1.1.~  2009-08-06 23:34:18.000000000 -0400
> +++ w32sock.h 2009-09-30 18:40:57.000212000 -0400
> @@ -17,6 +17,8 @@
> 
>   /* Written by Paolo Bonzini */
> 
> +#include <winsock2.h>
> +
>   #include <errno.h>
> 
>   /* Get O_RDWR and O_BINARY.  */
> =============================================================

This should not be needed. Please verify these assertions:

- In gethostname.c line 76..77 you should have this:

  /* Get winsock2.h. */
  #include <unistd.h>

- In config.status you should have the replacement rules
  GNULIB_GETHOSTNAME -> 1
  UNISTD_H_HAVE_WINSOCK2_H -> 1

- In the generated unistd.h the four lines

  #if @GNULIB_GETHOSTNAME@
  /* Get all possible declarations of gethostname().  */
  # if @UNISTD_H_HAVE_WINSOCK2_H@
  #  include <winsock2.h>

  should have become

  #if 1
  /* Get all possible declarations of gethostname().  */
  # if 1
  #  include <winsock2.h>

- When you add a -E option to that gcc command and look at the resulting
  '# ' or '#line' lines, you should see that this generated unistd.h file
  is being included.

- If you have multiple gnulib-generated unistd.h files and they are not
  equal, please verify that you are using different double-include
  guards in each (like you proposed yourself a couple of weeks ago).

Bruno




reply via email to

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