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: Wed, 20 Nov 2013 20:15:41 +0200

> From: address@hidden (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 
> <http://www.gnu.org/licenses/>.  */
> 
>  #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.



reply via email to

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