[Mingw-users] wincon.h update and some problems exposed by testing it.

Back to archive index

David Gressett DGres****@amli-*****
Thu Aug 2 08:03:51 JST 2018


>From: mingw****@lists***** [mailto:mingw****@lists*****] On Behalf Of Keith Marshall
>Sent: Tuesday, July 31, 2018 3:57 PM
>To: mingw****@lists*****
>Subject: Re: [Mingw-users] wincon.h update and some problems exposed by testing it.

>On 31/07/18 18:24, David Gressett wrote:
>>> Should link just fine!  MinGW *does* have _getwch(), insofar as it is 
>>> present in libmsvcrt.a; the problem, to which David is referring, is 
>>> that no one has >gotten around to adding the prototype to <conio.h>.
>>> 
>>> Should also execute fine ... provided no one tries to run it on a 
>>> pre-WinXP system.
>> 
>> So, I need to chew through conio.h as well.

>For a head start, try the attached.  It still needs some work, and, as it stands, will not work correctly if included after <wchar.h>; to fix that, <wchar.h> >needs an update, to have it include <conio.h>.

It worked, and my #define hack for _getwch() is no longer needed. 

While testing it, I found and fixed  several typos in my wincon.h patch, 
and updated my Slack post so that it now has the fixes.

I found another problem in my updated wincon.h which I did not fix,
 because I found other headers which has the same problem. 

The offending element is a struct definition which contains the constant LF_FACESIZE.

The MinGW definition of this is in wingdi.h, so I had to include it in my test program
before windows.h to  get it to compile. The test program now includes the system headers
wingdi.h and windows.h  and the C library headers conio.h, wchar.h, stdlib.h, and stdio.h.

Another header that uses, but does not define LF_FACESIZE is richedit.h. There are three others:

gdiplusflat.h
gdiplusheaders.h
gdiplusimpl.h

The Microsoft compiler seems to expect that LF_FACESIZE is defined inside windows.h or
some header that it includes, but not in wingdi.h









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