Re: [PATCH] (w32api) answer question about Watcom in windows.h

Danny Smith <[email protected]> Wed, 08 Jan 2003 09:23:05 +0000
Newsgroups gmane.comp.gnu.mingw.patches
Message-ID <000601c2b6f7$8f9e0370$8390a7cb@DANNY>
----- Original Message -----
From: "Bart Oldeman" <[email protected]>
To: <[email protected]>
Sent: Wednesday, 8 January 2003 05:08
Subject: [MinGW-patches] [PATCH] (w32api) answer question about Watcom
in windows.h


> Hi,
>
> the answer is now "yes"; otherwise lib/dinput.c doesn't compile.
> This problem only started recently, after the following change from
Danny
> Smith
>         * include/unknwn.h: Include windows.h and ole2.h before header
>         guard to avoid circular inclusion of COM headers.
> if ole2.h is not included by windows.h, then
> dinput.c includes windows.h (without OLE stuff)
> dinput.c includes objbase.h
> objbase.h includes unknwn.h
> unknwn.h includes ole2.h
> ole2.h includes oleauto.h
> oleauto.h includes oaidl.h
> oaidl.h needs the IUnknown typedef which is not defined yet.
>
> on the other hand, if windows.h includes ole2.h it all works fine!
>
> Something doesn't look right here but I'm not sure what exactly.
>
> maybe GCC<3 is problematic too now; I haven't checked that.
>
> Bart
>

Thanks
I have commited your patch and another one which also fixes the problem
dinput.c problem for both Warcon and gcc 2.95 (dinput.c only needed the
GUID typedef, not the whole  COM/OLE shebang)

I was tempted to just revert the unknwn.h change, and may do so later,
by just including windows.h (and not ole2.h) there. COM headers have a
habit of causing circularity problems.

Here is what I committed:

2003-01-08  Danny Smith  <[email protected]>

 * lib/dinput.c: Don't #include <objbase.h>.

2003-01-08  Bart Oldeman  <[email protected]>

 * include/windows.h (ole2.h):Do #include for
 __WATCOMC__.



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com