wtypes.h circular inclusion problem

Francois Gouget fgouget at free.fr
Mon Sep 16 05:58:54 CDT 2002


One Windows an application that just includes wtypes.h should compile.
But it did not on Wine because of a circular header inclusion problem:

 * foo.c includes wtypes.h
   * wtypes.h includes rpc.h
     * rpc.h includes wtypes.h
       That doesn't do a thing because of #ifndef __WINE_WTYPES_H
     * rpc.h includes unknwnh. which includes obj_base.h
       * obj_base.h uses LPOLESTR

Boum!

LPOLESTR is defined in wtypes.h but only after we have included 'rpc.h'.
So I moved the rpc.h include to the end.


Changelog:

 * include/wtypes.h

   Include rpc.h after LPOLESTR and other needed types are defined


Index: include/wtypes.h
===================================================================
RCS file: /home/wine/wine/include/wtypes.h,v
retrieving revision 1.35
diff -u -r1.35 wtypes.h
--- include/wtypes.h	12 Sep 2002 17:29:12 -0000	1.35
+++ include/wtypes.h	16 Sep 2002 10:56:57 -0000
@@ -20,12 +20,6 @@

 #ifndef __WINE_WTYPES_H
 #define __WINE_WTYPES_H
-
-#include "basetsd.h"
-#include "guiddef.h"
-#include "rpc.h"
-#include "rpcndr.h"
-
 typedef void* HMETAFILEPICT;

 typedef WORD CLIPFORMAT, *LPCLIPFORMAT;
@@ -295,5 +289,11 @@
 #define ROTFLAGS_REGISTRATIONKEEPSALIVE 0x1
 #define ROTFLAGS_ALLOWANYCLIENT 0x2
 #endif /* !defined(_ROTFLAGS_DEFINED) */
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#include "basetsd.h"
+#include "guiddef.h"

 #endif /* __WINE_WTYPES_H */



-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
  Good judgment comes from experience, and experience comes from bad judgment
                               -- Barry LePatner




More information about the wine-patches mailing list