From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: claudio.bley@gmail.com (Claudio Bley) Newsgroups: gmane.emacs.devel Subject: build fails with new MinGW wchar.h Date: Wed, 20 Nov 2013 08:24:06 +0100 Message-ID: <87d2lvv8mh.wl%claudio.bley@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1384932266 16894 80.91.229.3 (20 Nov 2013 07:24:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Nov 2013 07:24:26 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 20 08:24:31 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 1Vj29G-0001nY-Sd for ged-emacs-devel@m.gmane.org; Wed, 20 Nov 2013 08:24:31 +0100 Original-Received: from localhost ([::1]:53163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj29G-0005pd-Fl for ged-emacs-devel@m.gmane.org; Wed, 20 Nov 2013 02:24:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj298-0005p7-NU for emacs-devel@gnu.org; Wed, 20 Nov 2013 02:24:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vj293-0000pJ-Fj for emacs-devel@gnu.org; Wed, 20 Nov 2013 02:24:22 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:42055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj293-0000pF-8U for emacs-devel@gnu.org; Wed, 20 Nov 2013 02:24:17 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Vj292-0001h5-KX for emacs-devel@gnu.org; Wed, 20 Nov 2013 08:24:16 +0100 Original-Received: from 178-24-125-95-dynip.superkabel.de ([178.24.125.95]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Nov 2013 08:24:16 +0100 Original-Received: from claudio.bley by 178-24-125-95-dynip.superkabel.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Nov 2013 08:24:16 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 98 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 178-24-125-95-dynip.superkabel.de User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.3.50 (i686-pc-mingw32) MULE/6.0 (HANACHIRUSATO) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:165425 Archived-At: Hi. When trying to build emacs on w32 using the latest MinGW, the build failed for some reason I can't remember (something about mbstate_t being defined twice). Basically, it was because configure determined that the MinGW headers did not define mbstate_t in wchar.h which is actually wrong. The configure test failed with this error message: --------------------------------------------------------------------------------------------------------------- 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 _stat->st_ino = st.st_ino; ^ c:\mingw\include\wchar.h:826:10: error: dereferencing pointer to incomplete type _stat->st_mode = st.st_mode; ^ c:\mingw\include\wchar.h:827:10: error: dereferencing pointer to incomplete type _stat->st_nlink = st.st_nlink; ^ c:\mingw\include\wchar.h:828:10: error: dereferencing pointer to incomplete type _stat->st_uid = st.st_uid; ^ c:\mingw\include\wchar.h:829:10: error: dereferencing pointer to incomplete type _stat->st_gid = st.st_gid; ^ c:\mingw\include\wchar.h:830:10: error: dereferencing pointer to incomplete type _stat->st_rdev = st.st_rdev; ^ c:\mingw\include\wchar.h:831:10: error: dereferencing pointer to incomplete type _stat->st_size = (_off_t) st.st_size; ^ c:\mingw\include\wchar.h:832:10: error: dereferencing pointer to incomplete type _stat->st_atime = st.st_atime; ^ c:\mingw\include\wchar.h:833:10: error: dereferencing pointer to incomplete type _stat->st_mtime = st.st_mtime; ... --------------------------------------------------------------------------------------------------------------- The wchar.h header was installed from mingwrt-4.0.3-1-mingw32-dev: ,----[ wchar.h ] | /** | * @file wchar.h | * Copyright 2012, 2013 MinGW.org project `---- It duplicates definitions from sys/stat.h instead of including that file, conflicting with the overrides from nt/inc/sys/stat.h if both are included: ,----[ wchar.h ] | /* @TODO: Use sys/stat.h to define these instead of duplicated code. */ | #ifndef _STAT_DEFINED | ... | #endif | ... | #if !defined ( _WSTAT_DEFINED) /* also declared in sys/stat.h */ | ... `---- This patch fixes it for me: ---- 8< -------- >8 ---------------- 8< ------------- >8 ------------- 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 +# define _WSTAT_DEFINED #endif /* Only MinGW 3.13 and later has __MINGW_NOTHROW. */ ---- 8< -------- >8 ---------------- 8< ------------- >8 ------------- -- Claudio