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: Thu, 21 Nov 2013 19:36:41 +0200 Message-ID: <83a9gxejx2.fsf@gnu.org> References: <87d2lvv8mh.wl%claudio.bley@gmail.com> <837gc3ey7m.fsf@gnu.org> <8738mq4360.wl%claudio.bley@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1385055431 18525 80.91.229.3 (21 Nov 2013 17:37:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Nov 2013 17:37:11 +0000 (UTC) Cc: emacs-devel@gnu.org To: Claudio Bley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 21 18:37:15 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 1VjYBi-0000Tn-9T for ged-emacs-devel@m.gmane.org; Thu, 21 Nov 2013 18:37:10 +0100 Original-Received: from localhost ([::1]:34520 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjYBh-0005o5-UJ for ged-emacs-devel@m.gmane.org; Thu, 21 Nov 2013 12:37:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjYBK-0005S1-8V for emacs-devel@gnu.org; Thu, 21 Nov 2013 12:36:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjYBF-0003DF-4D for emacs-devel@gnu.org; Thu, 21 Nov 2013 12:36:46 -0500 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:48664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjYBE-0003D9-SW for emacs-devel@gnu.org; Thu, 21 Nov 2013 12:36:41 -0500 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MWM00200J399800@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Thu, 21 Nov 2013 19:36:39 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MWM002KAJL38J30@a-mtaout23.012.net.il>; Thu, 21 Nov 2013 19:36:39 +0200 (IST) In-reply-to: <8738mq4360.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.175 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:165497 Archived-At: > Date: Thu, 21 Nov 2013 08:36:23 +0100 > From: Claudio Bley > Cc: emacs-devel@gnu.org > > > > +# 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. > > Why? Since those declarations are not used anyway, what's the point in > defining them in the first place? They are not currently used in Emacs, that's true, but they _are_ used in wchar.h, which defines inline functions that reference members of these structs. That's why you got error messages in the first place. > Furthermore, this define actually does not guard declarations of any > structures, but only guards declarations of the functions: > > _wstat > _wstat32 > _wstat64 > _wstat32i64 > _wstat64i32 It guards both, because some of these functions are inline and use the struct. > IMO, since none of those functions is used in Emacs' code base, we're > already set. That would work for now, but is fragile: the moment the current arrangement changes a bit (e.g., we start using wchar_t functions in the Windows build), the problem will raise its ugly head again. We should play by the rules, and define these symbols only if everything they guard is indeed defined/declared.