[Mingw-users] Problems with compiling Windows system calls with MinGW gcc 6.3.0

Back to archive index

Earnie earni****@users*****
Fri Jun 29 04:39:37 JST 2018


On 6/27/2018 12:20 PM, Keith Marshall wrote:
> On 27/06/18 16:59, Eli Zaretskii wrote:
>>> #include <_mingw.h>
>>>>
>>>> #ifndef RTX
>>>> #define GNAT_UNICODE_SUPPORT
>>>> #define _UNICODE /* For C runtime */
>>>> #define UNICODE  /* For Win32 API */
>>>> #endif
>> This is supposed to define UNICODE unless RTX is defined.  Does that
>> mean RTX is defined in your case?  Because if it doesn't, then UNICODE
>> should have become defined, and should have caused 'TCHAR *' and
>> LPCTSTR become the same, and should have also caused
>> GetFileAttributesEx resolve to GetFileAttributesExW, which does expect
>> wchar_t strings.
> 
> That presupposes that UNICODE/_UNICODE have been defined in proper time;
> in OP's case, the code to map GetFileAttributesEx to it UNICODE vs. ANSI
> variant has already been specified to select GetFileAttributesExA, when
> he included <_mingw.h> *before* he defined UNICODE/_UNICODE.
> 
>> Which ones of these didn't work, and why?
> 
> The mapping was already defined, to GetFileAttributesExA, because he did
> not define UNICODE/_UNICODE in time ... that *must* come *before*
> 
>    #include <_mingw.h>
> 

The better fix would be to remove this include altogether as it is
included by every include file anyway.

-- 
Earnie




More information about the MinGW-Users mailing list
Back to archive index