emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: build fails with new MinGW wchar.h


From: Eli Zaretskii
Subject: Re: build fails with new MinGW wchar.h
Date: Thu, 21 Nov 2013 19:36:41 +0200

> Date: Thu, 21 Nov 2013 08:36:23 +0100
> From: Claudio Bley <address@hidden>
> Cc: address@hidden
> 
> > > +# 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]