* cannot build cygwin-2.0.2 because of net.cc (or because of some header.h)
@ 2015-05-11 18:07 Denis Excoffier
2015-05-21 11:53 ` Takashi Yano
0 siblings, 1 reply; 6+ messages in thread
From: Denis Excoffier @ 2015-05-11 18:07 UTC (permalink / raw)
To: The Cygwin Mailing List
Hello,
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.
Regards,
Denis Excoffier
diff -uNr newlib-cygwin-o/winsup/cygwin/net.cc newlib-cygwin-p/winsup/cygwin/net.cc
--- newlib-cygwin-o/winsup/cygwin/net.cc 2015-05-08 23:51:08.000000000 +0200
+++ newlib-cygwin-p/winsup/cygwin/net.cc 2015-05-11 10:12:57.816299800 +0200
@@ -2444,7 +2444,7 @@
return -1;
}
-extern "C" unsigned
+extern "C" NET_IFINDEX
if_nametoindex (const char *name)
{
PIP_ADAPTER_ADDRESSES pa0 = NULL, pap;
@@ -2478,7 +2478,7 @@
}
extern "C" char *
-if_indextoname (unsigned ifindex, char *ifname)
+if_indextoname (NET_IFINDEX ifindex, char *ifname)
{
PIP_ADAPTER_ADDRESSES pa0 = NULL, pap;
char *name = NULL;
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: cannot build cygwin-2.0.2 because of net.cc (or because of some header.h)
2015-05-11 18:07 cannot build cygwin-2.0.2 because of net.cc (or because of some header.h) Denis Excoffier
@ 2015-05-21 11:53 ` Takashi Yano
2015-05-22 11:07 ` Takashi Yano
0 siblings, 1 reply; 6+ messages in thread
From: Takashi Yano @ 2015-05-21 11:53 UTC (permalink / raw)
To: cygwin
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.
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: cannot build cygwin-2.0.2 because of net.cc (or because of some header.h)
2015-05-21 11:53 ` Takashi Yano
@ 2015-05-22 11:07 ` Takashi Yano
2015-05-27 11:15 ` Corinna Vinschen
0 siblings, 1 reply; 6+ messages in thread
From: Takashi Yano @ 2015-05-22 11:07 UTC (permalink / raw)
To: cygwin
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: cannot build cygwin-2.0.2 because of net.cc (or because of some header.h)
2015-05-22 11:07 ` Takashi Yano
@ 2015-05-27 11:15 ` Corinna Vinschen
2015-05-27 11:48 ` Henry S. Thompson
0 siblings, 1 reply; 6+ messages in thread
From: Corinna Vinschen @ 2015-05-27 11:15 UTC (permalink / raw)
To: cygwin
[-- Attachment #1: Type: text/plain, Size: 1827 bytes --]
On May 22 19:37, Takashi Yano wrote:
> 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)
I applied this patch.
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-05-27 12:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-11 18:07 cannot build cygwin-2.0.2 because of net.cc (or because of some header.h) Denis Excoffier
2015-05-21 11:53 ` Takashi Yano
2015-05-22 11:07 ` Takashi Yano
2015-05-27 11:15 ` Corinna Vinschen
2015-05-27 11:48 ` Henry S. Thompson
2015-05-27 13:06 ` Corinna Vinschen
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).