public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin@cygwin.com
Subject: Re: cannot build cygwin-2.0.2 because of net.cc (or because of some header.h)
Date: Fri, 22 May 2015 11:07:00 -0000	[thread overview]
Message-ID: <20150522193704.b0b9dfdaa4d63c61d7d5be55@nifty.ne.jp> (raw)
In-Reply-To: <20150521201509.9b9bfcffb07b3d9337de9e10@nifty.ne.jp>

On Thu, 21 May 2015 20:15:09 +0900
Takashi Yano <takashi.yano@nifty.ne.jp> wrote:

> On Mon, 11 May 2015 17:52:04 +0200
> Denis Excoffier wrote:
> 
> > In order to successfully build cygwin-2.0.2-1 (for x86, both XP and W7) i had to apply
> > the following patch (below). No such problem with cygwin-2.0.1-1.
> 
> In my case, the same problem is caused by upgrading
> w32api-headers to 4.0.2-1. It does not result from
> difference between cygwin-2.0.2-1 and cygwin-2.0.1-1.

I have looked into this problem. The cause is as follows.

netioapi.h in w32api-headers 3.3.0-2 was using a macro-name
_INC_NETIOAPI for include-guard. By defining _INC_NETIOAPI,
net.cc avoids including netioapi.h, which conflicts with
if_nametoindex() and if_indextoname() in it.

However, the macro-name for include-guard in netioapi.h of
w32api-headers 4.0.2-1 has been changed to _NETIOAPI_H_.

As a result, net.cc fails to avoid including netioapi.h,
which causes confliction.

Thus, defining _NETIOAPI_H_ in net.cc resolves the problem.


diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index eaf6eb8..d6a631b 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -19,6 +19,7 @@ details. */
    TODO:  Convert if_nametoindex to cygwin_if_nametoindex and call
 	  system functions on Vista and later. */
 #define _INC_NETIOAPI
+#define _NETIOAPI_H_
 #include "winsup.h"
 #ifdef __x86_64__
 /* 2014-04-24: Current Mingw headers define sockaddr_in6 using u_long (8 byte)


-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2015-05-22 10:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-11 18:07 Denis Excoffier
2015-05-21 11:53 ` Takashi Yano
2015-05-22 11:07   ` Takashi Yano [this message]
2015-05-27 11:15     ` Corinna Vinschen
2015-05-27 11:48       ` Henry S. Thompson
2015-05-27 13:06         ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150522193704.b0b9dfdaa4d63c61d7d5be55@nifty.ne.jp \
    --to=takashi.yano@nifty.ne.jp \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).