PATCH: include mess up
Francois Gouget
fgouget at free.fr
Sat Jul 14 20:32:28 CDT 2001
On Wed, 11 Jul 2001, Marcus Meissner wrote:
[...]
> I am just trying to compile shdocvw out of the tree and get following
> error. (You should basically be able to reproduce it by compiling shdocvw
> with out __WINE__ defined.)
Yes, I tried with a simple test application that just includes
'rpc.h' as the first thing and does nothing else. It compiles fine on
windows but not with Winelib. I have already seen this problem before.
Winelib headers often require that you have your include sequence right
while windows headers will just include the big windows.h for you :-/
This is exactly what happens here with a twist: 'windows.h' must be
included before the '#ifndef RPC_H'. I hate it when headers do that
(hello glibc), but I guess we don't have much choice. If we don't do
that too then we'll keep having windows applications that don't compile
because of missing #includes or their order.
So here's a batch of fixes, for #include windows.h directives that
are protected by {COM,RPC}_NO_WINDOWS.
Changelog:
* include/comcat.h,
include/docobj.h,
include/oaidl.h,
include/objidl.h,
include/ocidl.h,
include/oleidl.h,
include/rpc.h,
include/servprov.h,
include/strmif.h,
include/unknwn.h,
include/urlmon.h,
Include rpc*.h/windows.h/ole2.h just like windows
--
Francois Gouget fgouget at free.fr http://fgouget.free.fr/
We are Pentium of Borg. You will be approximated. Division is futile.
-------------- next part --------------
Index: include/comcat.h
===================================================================
RCS file: /home/wine/wine/include/comcat.h,v
retrieving revision 1.2
diff -u -r1.2 comcat.h
--- include/comcat.h 2000/11/25 03:08:34 1.2
+++ include/comcat.h 2001/07/14 23:50:13
@@ -1,13 +1,14 @@
-#ifndef __WINE_COMCAT_H
-#define __WINE_COMCAT_H
-
+#ifndef __WINE__
#include "rpc.h"
#include "rpcndr.h"
-
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif
+#endif
+
+#ifndef __WINE_COMCAT_H
+#define __WINE_COMCAT_H
#include "unknwn.h"
Index: include/docobj.h
===================================================================
RCS file: /home/wine/wine/include/docobj.h,v
retrieving revision 1.7
diff -u -r1.7 docobj.h
--- include/docobj.h 2000/02/10 19:03:07 1.7
+++ include/docobj.h 2001/07/14 23:50:14
@@ -1,3 +1,12 @@
+#ifndef __WINE__
+#include "rpc.h"
+#include "rpcndr.h"
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif
+#endif
+
#ifndef __WINE_DOCOBJ_H
#define __WINE_DOCOBJ_H
Index: include/oaidl.h
===================================================================
RCS file: /home/wine/wine/include/oaidl.h,v
retrieving revision 1.4
diff -u -r1.4 oaidl.h
--- include/oaidl.h 1999/03/10 18:03:53 1.4
+++ include/oaidl.h 2001/07/14 23:50:14
@@ -1,3 +1,12 @@
+#ifndef __WINE__
+#include "rpc.h"
+#include "rpcndr.h"
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif
+#endif
+
#ifndef __WINE_OAIDL_H
#define __WINE_OAIDL_H
Index: include/objidl.h
===================================================================
RCS file: /home/wine/wine/include/objidl.h,v
retrieving revision 1.5
diff -u -r1.5 objidl.h
--- include/objidl.h 1999/02/19 10:00:55 1.5
+++ include/objidl.h 2001/07/14 23:50:14
@@ -1,3 +1,12 @@
+#ifndef __WINE__
+#include "rpc.h"
+#include "rpcndr.h"
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif
+#endif
+
#ifndef __WINE_OBJIDL_H
#define __WINE_OBJIDL_H
Index: include/ocidl.h
===================================================================
RCS file: /home/wine/wine/include/ocidl.h,v
retrieving revision 1.5
diff -u -r1.5 ocidl.h
--- include/ocidl.h 2000/11/30 01:31:29 1.5
+++ include/ocidl.h 2001/07/14 23:50:14
@@ -1,10 +1,14 @@
-#ifndef __WINE_OCIDL_H
-#define __WINE_OCIDL_H
-
-#if !defined(COM_NO_WINDOWS_H) && !defined(__WINE__)
+#ifndef __WINE__
+#include "rpc.h"
+#include "rpcndr.h"
+#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif
+#endif
+
+#ifndef __WINE_OCIDL_H
+#define __WINE_OCIDL_H
#include "wine/obj_base.h"
Index: include/oleidl.h
===================================================================
RCS file: /home/wine/wine/include/oleidl.h,v
retrieving revision 1.5
diff -u -r1.5 oleidl.h
--- include/oleidl.h 2000/09/26 00:00:59 1.5
+++ include/oleidl.h 2001/07/14 23:50:14
@@ -1,3 +1,12 @@
+#ifndef __WINE__
+#include "rpc.h"
+#include "rpcndr.h"
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif
+#endif
+
#ifndef __WINE_OLEIDL_H
#define __WINE_OLEIDL_H
Index: include/rpc.h
===================================================================
RCS file: /home/wine/wine/include/rpc.h,v
retrieving revision 1.6
diff -u -r1.6 rpc.h
--- include/rpc.h 2001/07/11 20:19:06 1.6
+++ include/rpc.h 2001/07/14 23:50:14
@@ -2,12 +2,12 @@
* RPC interface
*
*/
-#ifndef __WINE_RPC_H
-#define __WINE_RPC_H
-
#if !defined(RPC_NO_WINDOWS_H) && !defined(__WINE__)
#include "windows.h"
#endif
+
+#ifndef __WINE_RPC_H
+#define __WINE_RPC_H
#define __RPC_FAR
#define __RPC_API WINAPI
Index: include/servprov.h
===================================================================
RCS file: /home/wine/wine/include/servprov.h,v
retrieving revision 1.3
diff -u -r1.3 servprov.h
--- include/servprov.h 1999/10/23 20:09:06 1.3
+++ include/servprov.h 2001/07/14 23:50:14
@@ -1,3 +1,12 @@
+#ifndef __WINE__
+#include "rpc.h"
+#include "rpcndr.h"
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif
+#endif
+
#ifndef __WINE_SERVPROV_H
#define __WINE_SERVPROV_H
Index: include/strmif.h
===================================================================
RCS file: /home/wine/wine/include/strmif.h,v
retrieving revision 1.2
diff -u -r1.2 strmif.h
--- include/strmif.h 2001/07/08 20:29:48 1.2
+++ include/strmif.h 2001/07/14 23:50:15
@@ -1,3 +1,12 @@
+#ifndef __WINE__
+#include "rpc.h"
+#include "rpcndr.h"
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif
+#endif
+
#ifndef __WINE_STRMIF_H_
#define __WINE_STRMIF_H_
Index: include/unknwn.h
===================================================================
RCS file: /home/wine/wine/include/unknwn.h,v
retrieving revision 1.3
diff -u -r1.3 unknwn.h
--- include/unknwn.h 2000/11/30 01:31:29 1.3
+++ include/unknwn.h 2001/07/14 23:50:15
@@ -1,13 +1,14 @@
-#ifndef __WINE_UNKNWN_H
-#define __WINE_UNKNWN_H
-
+#ifndef __WINE__
#include "rpc.h"
#include "rpcndr.h"
-
-#if !defined(COM_NO_WINDOWS_H) && !defined(__WINE__)
+#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif
+#endif
+
+#ifndef __WINE_UNKNWN_H
+#define __WINE_UNKNWN_H
#include "wine/obj_base.h"
Index: include/urlmon.h
===================================================================
RCS file: /home/wine/wine/include/urlmon.h,v
retrieving revision 1.5
diff -u -r1.5 urlmon.h
--- include/urlmon.h 2001/07/02 17:58:01 1.5
+++ include/urlmon.h 2001/07/14 23:50:15
@@ -2,6 +2,15 @@
* urlmon.h
*/
+#ifndef __WINE__
+#include "rpc.h"
+#include "rpcndr.h"
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif
+#endif
+
#ifndef __WINE_URLMON_H
#define __WINE_URLMON_H
More information about the wine-patches
mailing list