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

Bart Oldeman <[email protected]> Wed, 08 Jan 2003 00:08:13 -0500 (EST)
Newsgroups gmane.comp.gnu.mingw.patches
Message-ID <[email protected]>
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

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

	* include/windows.h (ole2.h): #include if !__OBJC__ and
		__WATCOMC__ too.


Index: w32api/include/windows.h
===================================================================
RCS file: /cvs/src/src/winsup/w32api/include/windows.h,v
retrieving revision 1.15
diff -u -r1.15 windows.h
--- w32api/include/windows.h	15 Dec 2002 20:55:36 -0000	1.15
+++ w32api/include/windows.h	8 Jan 2003 05:02:43 -0000
@@ -107,7 +107,7 @@
 #endif
 #ifndef NOGDI
 #if !defined (__OBJC__)
-#if  __GNUC__ >= 3  /* what about Watcom? */
+#if  __GNUC__ >= 3  || defined(__WATCOMC__)
 #include <ole2.h>
 #endif
 #endif /* __OBJC__ */



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