From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: build fails with new MinGW wchar.h Date: Wed, 20 Nov 2013 20:15:41 +0200 Message-ID: <837gc3ey7m.fsf@gnu.org> References: <87d2lvv8mh.wl%claudio.bley@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1384971391 31907 80.91.229.3 (20 Nov 2013 18:16:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Nov 2013 18:16:31 +0000 (UTC) Cc: emacs-devel@gnu.org To: claudio.bley@gmail.com (Claudio Bley) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 20 19:16:36 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VjCKG-0002LL-Mj for ged-emacs-devel@m.gmane.org; Wed, 20 Nov 2013 19:16:32 +0100 Original-Received: from localhost ([::1]:56315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjCKG-0003XN-7x for ged-emacs-devel@m.gmane.org; Wed, 20 Nov 2013 13:16:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjCK8-0003Wq-75 for emacs-devel@gnu.org; Wed, 20 Nov 2013 13:16:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjCJz-0004N6-Me for emacs-devel@gnu.org; Wed, 20 Nov 2013 13:16:24 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:56049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjCJz-0004Mq-E9 for emacs-devel@gnu.org; Wed, 20 Nov 2013 13:16:15 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MWK00L00QIH7B00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Wed, 20 Nov 2013 20:15:45 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MWK00JE4QQ5U151@a-mtaout20.012.net.il>; Wed, 20 Nov 2013 20:15:41 +0200 (IST) In-reply-to: <87d2lvv8mh.wl%claudio.bley@gmail.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:165444 Archived-At: > From: claudio.bley@gmail.com (Claudio Bley) > Date: Wed, 20 Nov 2013 08:24:06 +0100 > > c:\mingw\include\wchar.h:816:32: error: conflicting types for '_wstat64i32' > __CRT_MAYBE_INLINE int __cdecl _wstat64i32(const wchar_t *fname, struct _stat64i32 *_stat) > ^ > c:\mingw\include\wchar.h:814:29: note: previous declaration of '_wstat64i32' was here > int __cdecl __MINGW_NOTHROW _wstat64i32 (const wchar_t*, struct _stat64i32*); > ^ > c:\mingw\include\wchar.h: In function '_wstat64i32': > c:\mingw\include\wchar.h:818:20: error: storage size of 'st' isn't known > struct _stat64 st; > ^ > c:\mingw\include\wchar.h:821:31: error: invalid application of 'sizeof' to incomplete type 'struct _stat64i32' > memset(_stat, 0, sizeof(struct _stat64i32)); > ^ > c:\mingw\include\wchar.h:824:10: error: dereferencing pointer to incomplete type > _stat->st_dev = st.st_dev; > ^ > c:\mingw\include\wchar.h:825:10: error: dereferencing pointer to incomplete type The reason is that MinGW Runtime 4.x added a few more variants of 'struct stat', which nt/inc/sys/stat.h does not have. > This patch fixes it for me: Thanks. > diff --git a/nt/inc/sys/stat.h b/nt/inc/sys/stat.h > index f1d8341..88352b1 100644 > --- a/nt/inc/sys/stat.h > +++ b/nt/inc/sys/stat.h > @@ -23,6 +23,8 @@ along with GNU Emacs. If not, see . */ > > #ifdef __MINGW32__ > # include <_mingw.h> > +# define _STAT_DEFINED Why did you need this part? nt/inc/sys/stat.h already defines _STAT_DEFINED, why do we need a second definition. > +# define _WSTAT_DEFINED We cannot define this symbol without also declaring the structures guarded by it in the MinGW headers. We should add them, and then define _WSTAT_DEFINED.