David Gressett
DGres****@amli-*****
Thu Jun 28 02:33:12 JST 2018
>From: mingw****@lists***** [mailto:mingw****@lists*****] On Behalf Of Keith Marshall >Sent: Wednesday, June 27, 2018 10:37 AM >To: mingw****@lists***** >Subject: Re: [Mingw-users] Problems with compiling Windows system calls with MinGW gcc 6.3.0 >On 27/06/18 01:06, David Gressett wrote: >> #ifndef _MINGW32_H >> #define _MINGW32_H >> >> #include <_mingw.h> >> >> #ifndef RTX >> #define GNAT_UNICODE_SUPPORT >> #define _UNICODE /* For C runtime */ >> #define UNICODE /* For Win32 API */ >> #endif >This is wrong, and appears to be the cause of your issue. Feature test macros, such as UNICODE/_UNICODE in this case, *must* be defined >*before* any system header file, (or ideally *any* header file), is included; here you delay the definition until after <_mingw.h> has been included, by which time it is too late. >If I correct this, such that it becomes: > #ifndef _MINGW32_H > #define _MINGW32_H > #ifndef RTX > #define GNAT_UNICODE_SUPPORT > #define _UNICODE /* For C runtime */ > #define UNICODE /* For Win32 API */ > #endif > #include <_mingw.h> >your example code compiles without error; without the correction, I see the type incompatibility error as you report it. >-- >Regards, >Keith. Good. I was hoping that it would be something simple. I checked the source code for gcc 6.3.0 and 7.1.0 and the location of the offending declarations was correct, as I expected from your analysis. gcc 7.2.0, which I did not try to build, has it right also. The error first appears in gcc 7.3.0 and is also in gcc 8.1.0. So, one more patch and then a new build. Since my fear that this was a WSL problem was fortunately not correct, I will take the results of my next build to the Slack Mingw developer forum.