X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type :content-transfer-encoding; q=dns; s=default; b=ZrBxDzq/UKxM+ovW v34O9cdiZdvd3l5+0ebfQpApYvqlLJ6B70V2yVVZDOzDpPBKy8gfbUFbkHVHW3L9 w1jFBtna2mabxCvVWrzn3eBbOA8FFb2+Fij0SZWawvQnm6fblivyT9vzYtgqL3nu 6l4Q+fkYiRg+AhtDmYN02dDLCUs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type :content-transfer-encoding; s=default; bh=DmsCVNIlUQsp2CfYTVfMdB wvgsg=; b=LsJxbFgCm1W6iYxg6NxEPXO70KhKaMWoJqsQfekghxMPZ+I1dIxIsN LCdX91fQhiNSSoba8IVsUGFv20bfHIxMXt4lUqbOgfxeXla4PclP4COPlIk9d0lK lQv+2n5mm6TL6u+tyB+Jtgbji737ZUsEdkaZKWUoIJ0UiidMeWfDo= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.1 MIME-Version: 1.0 X-Received: by 10.60.60.71 with SMTP id f7mr15062536oer.71.1366839947431; Wed, 24 Apr 2013 14:45:47 -0700 (PDT) In-Reply-To: <51782672.10509@cygwin.com> References: <20130424154409 DOT GX26397 AT calimero DOT vinschen DOT de> <20130424175107 DOT GZ26397 AT calimero DOT vinschen DOT de> <20130424175359 DOT GH5968 AT type DOT youpi DOT perso DOT aquilenet DOT fr> <20130424181248 DOT GA26397 AT calimero DOT vinschen DOT de> <51782672 DOT 10509 AT cygwin DOT com> Date: Wed, 24 Apr 2013 23:45:47 +0200 Message-ID: Subject: Re: Redefinition of `struct in6_addr'? From: Max Balduino To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id r3OLk03O010176 > On 4/24/2013 2:12 PM, Corinna Vinschen wrote: >> >> On Apr 24 19:53, Samuel Thibault wrote: >>> >>> Corinna Vinschen, le Wed 24 Apr 2013 19:51:07 +0200, a écrit : >>>>>> >>>>>> /usr/include/cygwin/in6.h:75:8: error: redefinition of ‘struct >>>>>> in6_addr’ >>>>>> >>>>>> /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/in6addr.h:17:16: >>>>>> note: originally defined here >>>> >>>> >>>> Don't know this file but this is a bug in config.h. struct in6_addr >>>> is defined in a system header, so it should not be gratuitously defined >>>> in a project header, especially if the definition collides with the >>>> right one from the system header. >>> >>> >>> Mmm, but here it's w32api definition vs cygwin definition. >> >> >> Maybe I didn't read it exactly, but the bottom line here is, when >> building for Cygwin, either use the POSIX network headers (preferredly), >> or use winsock.h. Mixing them is not supported. > > > Yeah, though this case is a bit buried, so it's not obvious. Also the code > is from 2008, so I expect it has suffered some bit rot over time with > respect to Cygwin. In any case, it looks like removing iphlpapi.h from > sysdep.c solves the problem. Hey, I got it! It's not cygwin fault... It's the inclusion of which is done for the first time in sysdep.h, AFTER the inclusions of the winapi32, where struct in6_addr is declared. Actually sysdep.c includes its header at the end of the inclusion list and sysdep.h in its turn has an inclusion for . The solution is in the following patch: --- //ioxp/cygwin/usr/src/vpnc-0.5.3/sysdep.c mer nov 19 21:02:39 2008 +++ //ioxp/cygwin/usr/src/vpnc-0.5.3.1/sysdep.c mer apr 24 21:53:29 2013 @@ -28,6 +28,7 @@ #include #include +#include #ifdef __sun__ #include @@ -38,7 +39,6 @@ #include #include #include -#include #include #include #include Basically the #include has to be moved up a few lines to get it out of the #ifdef __sun__ ... #endif directive. This way the winapi32 headers don't declare struct in6_addr, I didn't check, but I guess they do so only #ifndef _CYGWIN_IN6_H, am I right? For ease of reading, here are the inclusions in sysdep.c as patched by me: #include #include #include #include #include #include #include #include #include #include #include #ifdef __sun__ #include #include #include #include #include #include #include #include #include #include #include #endif #if defined(__CYGWIN__) #include #include #include #include #include #include #include #include #include #endif #if defined(__DragonFly__) #include #elif defined(__linux__) #include #elif defined(__APPLE__) /* no header for tun */ #elif defined(__CYGWIN__) #include "tap-win32.h" #else #include #endif #include "sysdep.h" #if !defined(HAVE_VASPRINTF) || !defined(HAVE_ASPRINTF) || !defined(HAVE_ERROR) #include #endif #if defined(__sun__) extern char **environ; static int ip_fd = -1, muxid; #endif OK, so that's it, vpnc-0.5.3 will then compile like a charm. Ah, by the way, you must have perl installed and run ./enum2debug.pl isakmp.h >vpnc-debug.c 2>vpnc-debug.h right before to make. Thanks to all for attention, and once again sorry if I dared to post in the wrong mailing list. You must be patient I'm just a newcomer... Didn't mean to bother!! :-) BR, Max -- 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