Add COBJMACROS

Francois Gouget fgouget at free.fr
Wed Aug 11 08:15:40 CDT 2004


In the Windows headers, all the C COM macros are protected by:

#ifdef COBJMACROS
#define IUnknown_QueryInterface...
...
#endif

But Wine's headers are missing these which caused some of our
conformance tests (olefont.c, url.c) to fail to compile when I tried to
compile them with the Windows headers. This patch brings Wine into
conformance with the Windows headers, adds #define COBJMACROS where
needed in Wine, and fixes the compilation problems with the Windows
headers.

Note: I did not send the modified include headers so not bloat the
patch. After applying this patch, simply run 'make idl' in include and
check in the modified headers (see list below).


Changelog:

 * dlls/dmband/dmband_private.h
   dlls/dmband/dmutils.c
   dlls/dmcompos/dmcompos_private.h
   dlls/dmime/dmime_private.h
   dlls/dmime/dmutils.c
   dlls/dmloader/dmloader_private.h
   dlls/dmscript/dmscript_private.h
   dlls/dmstyle/dmstyle_private.h
   dlls/dmstyle/dmutils.c
   dlls/dmsynth/dmsynth_private.h
   dlls/dmusic/dmusic_private.h
   dlls/dswave/dswave_private.h
   dlls/msi/record.c
   dlls/ole32/errorinfo.c
   dlls/oleaut32/olefont.c
   dlls/oleaut32/safearray.c
   dlls/oleaut32/variant.c
   dlls/oleaut32/vartype.c
   dlls/oleaut32/tests/olefont.c
   dlls/shell32/shlview.c
   dlls/shlwapi/ordinal.c
   dlls/urlmon/tests/url.c
   include/activscp.h
   include/amstream.h
   include/amvideo.h
   include/austream.h
   include/comcat.h
   include/ddstream.h
   include/dispex.h
   include/docobj.h
   include/exdisp.h
   include/mlang.h
   include/mmstream.h
   include/oaidl.h
   include/objidl.h
   include/ocidl.h
   include/oleidl.h
   include/pstore.h
   include/servprov.h
   include/shldisp.h
   include/shobjidl.h
   include/strmif.h
   include/unknwn.h
   include/urlmon.h
   tools/widl/header.c

   Modify widl to put the C COM macros inside an #ifdef COBJMACROS
block as is done in the Windows headers.
   Add #define COBJMACROS where needed in Wine.
   Fixes the compilation of the oleaut32/tests/olefont.c and
urlmon/tests/url.c conformance tests with the Windows headers.



Index: dlls/dmband/dmband_private.h
===================================================================
RCS file: /var/cvs/wine/dlls/dmband/dmband_private.h,v
retrieving revision 1.9
diff -u -r1.9 dmband_private.h
--- dlls/dmband/dmband_private.h	14 May 2004 04:57:02 -0000	1.9
+++ dlls/dmband/dmband_private.h	10 Aug 2004 21:53:14 -0000
@@ -24,6 +24,8 @@
 #include <stdarg.h>
 #include <string.h>

+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winnt.h"
Index: dlls/dmband/dmutils.c
===================================================================
RCS file: /var/cvs/wine/dlls/dmband/dmutils.c,v
retrieving revision 1.1
diff -u -r1.1 dmutils.c
--- dlls/dmband/dmutils.c	14 May 2004 04:57:02 -0000	1.1
+++ dlls/dmband/dmutils.c	10 Aug 2004 22:17:53 -0000
@@ -22,6 +22,8 @@
 #include <stdarg.h>
 #include <string.h>

+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winnt.h"
Index: dlls/dmcompos/dmcompos_private.h
===================================================================
RCS file: /var/cvs/wine/dlls/dmcompos/dmcompos_private.h,v
retrieving revision 1.5
diff -u -r1.5 dmcompos_private.h
--- dlls/dmcompos/dmcompos_private.h	25 Feb 2004 01:30:04 -0000	1.5
+++ dlls/dmcompos/dmcompos_private.h	10 Aug 2004 21:53:49 -0000
@@ -24,6 +24,8 @@
 #include <stdarg.h>
 #include <string.h>

+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winnt.h"
Index: dlls/dmime/dmime_private.h
===================================================================
RCS file: /var/cvs/wine/dlls/dmime/dmime_private.h,v
retrieving revision 1.17
diff -u -r1.17 dmime_private.h
--- dlls/dmime/dmime_private.h	20 May 2004 01:15:30 -0000	1.17
+++ dlls/dmime/dmime_private.h	10 Aug 2004 21:54:14 -0000
@@ -24,6 +24,8 @@
 #include <stdarg.h>
 #include <string.h>

+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winnt.h"
Index: dlls/dmime/dmutils.c
===================================================================
RCS file: /var/cvs/wine/dlls/dmime/dmutils.c,v
retrieving revision 1.1
diff -u -r1.1 dmutils.c
--- dlls/dmime/dmutils.c	14 May 2004 04:57:02 -0000	1.1
+++ dlls/dmime/dmutils.c	10 Aug 2004 22:18:15 -0000
@@ -22,6 +22,8 @@
 #include <stdarg.h>
 #include <string.h>

+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winnt.h"
Index: dlls/dmloader/dmloader_private.h
===================================================================
RCS file: /var/cvs/wine/dlls/dmloader/dmloader_private.h,v
retrieving revision 1.8
diff -u -r1.8 dmloader_private.h
--- dlls/dmloader/dmloader_private.h	13 May 2004 00:00:22 -0000	1.8
+++ dlls/dmloader/dmloader_private.h	10 Aug 2004 21:54:45 -0000
@@ -24,6 +24,8 @@
 #include <stdarg.h>
 #include <string.h>

+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winnt.h"
Index: dlls/dmscript/dmscript_private.h
===================================================================
RCS file: /var/cvs/wine/dlls/dmscript/dmscript_private.h,v
retrieving revision 1.7
diff -u -r1.7 dmscript_private.h
--- dlls/dmscript/dmscript_private.h	10 May 2004 19:56:17 -0000	1.7
+++ dlls/dmscript/dmscript_private.h	10 Aug 2004 21:55:19 -0000
@@ -24,6 +24,8 @@
 #include <stdarg.h>
 #include <string.h>

+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winnt.h"
Index: dlls/dmstyle/dmstyle_private.h
===================================================================
RCS file: /var/cvs/wine/dlls/dmstyle/dmstyle_private.h,v
retrieving revision 1.8
diff -u -r1.8 dmstyle_private.h
--- dlls/dmstyle/dmstyle_private.h	14 May 2004 21:36:15 -0000	1.8
+++ dlls/dmstyle/dmstyle_private.h	10 Aug 2004 21:55:47 -0000
@@ -24,6 +24,8 @@
 #include <stdarg.h>
 #include <string.h>

+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winnt.h"
Index: dlls/dmstyle/dmutils.c
===================================================================
RCS file: /var/cvs/wine/dlls/dmstyle/dmutils.c,v
retrieving revision 1.1
diff -u -r1.1 dmutils.c
--- dlls/dmstyle/dmutils.c	14 May 2004 04:57:02 -0000	1.1
+++ dlls/dmstyle/dmutils.c	10 Aug 2004 22:18:30 -0000
@@ -22,6 +22,8 @@
 #include <stdarg.h>
 #include <string.h>

+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winnt.h"
Index: dlls/dmsynth/dmsynth_private.h
===================================================================
RCS file: /var/cvs/wine/dlls/dmsynth/dmsynth_private.h,v
retrieving revision 1.4
diff -u -r1.4 dmsynth_private.h
--- dlls/dmsynth/dmsynth_private.h	25 Feb 2004 01:30:03 -0000	1.4
+++ dlls/dmsynth/dmsynth_private.h	10 Aug 2004 21:56:30 -0000
@@ -22,6 +22,8 @@

 #include <stdarg.h>

+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winnt.h"
Index: dlls/dmusic/dmusic_private.h
===================================================================
RCS file: /var/cvs/wine/dlls/dmusic/dmusic_private.h,v
retrieving revision 1.19
diff -u -r1.19 dmusic_private.h
--- dlls/dmusic/dmusic_private.h	25 Feb 2004 01:30:03 -0000	1.19
+++ dlls/dmusic/dmusic_private.h	10 Aug 2004 21:56:56 -0000
@@ -22,6 +22,8 @@

 #include <stdarg.h>

+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winnt.h"
Index: dlls/dswave/dswave_private.h
===================================================================
RCS file: /var/cvs/wine/dlls/dswave/dswave_private.h,v
retrieving revision 1.2
diff -u -r1.2 dswave_private.h
--- dlls/dswave/dswave_private.h	25 Feb 2004 01:30:03 -0000	1.2
+++ dlls/dswave/dswave_private.h	10 Aug 2004 21:57:25 -0000
@@ -22,6 +22,8 @@

 #include <stdarg.h>

+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winnt.h"
Index: dlls/msi/record.c
===================================================================
RCS file: /var/cvs/wine/dlls/msi/record.c,v
retrieving revision 1.13
diff -u -r1.13 record.c
--- dlls/msi/record.c	9 Jul 2004 22:25:34 -0000	1.13
+++ dlls/msi/record.c	10 Aug 2004 21:57:54 -0000
@@ -20,6 +20,8 @@

 #include <stdarg.h>

+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winuser.h"
Index: dlls/ole32/errorinfo.c
===================================================================
RCS file: /var/cvs/wine/dlls/ole32/errorinfo.c,v
retrieving revision 1.18
diff -u -r1.18 errorinfo.c
--- dlls/ole32/errorinfo.c	10 Feb 2004 01:36:20 -0000	1.18
+++ dlls/ole32/errorinfo.c	10 Aug 2004 15:09:43 -0000
@@ -26,6 +26,8 @@
 #include <stdarg.h>
 #include <string.h>

+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "oleauto.h"
Index: dlls/oleaut32/olefont.c
===================================================================
RCS file: /var/cvs/wine/dlls/oleaut32/olefont.c,v
retrieving revision 1.26
diff -u -r1.26 olefont.c
--- dlls/oleaut32/olefont.c	20 Apr 2004 02:14:00 -0000	1.26
+++ dlls/oleaut32/olefont.c	10 Aug 2004 21:50:54 -0000
@@ -24,8 +24,10 @@
 #include <stdarg.h>
 #include <string.h>

+#define COBJMACROS
 #define NONAMELESSUNION
 #define NONAMELESSSTRUCT
+
 #include "winerror.h"
 #include "windef.h"
 #include "winbase.h"
Index: dlls/oleaut32/safearray.c
===================================================================
RCS file: /var/cvs/wine/dlls/oleaut32/safearray.c,v
retrieving revision 1.37
diff -u -r1.37 safearray.c
--- dlls/oleaut32/safearray.c	4 Jul 2004 00:09:11 -0000	1.37
+++ dlls/oleaut32/safearray.c	10 Aug 2004 21:51:32 -0000
@@ -36,6 +36,9 @@
 #include <string.h>
 #include <stdarg.h>
 #include <stdio.h>
+
+#define COBJMACROS
+
 #include "windef.h"
 #include "winerror.h"
 #include "winbase.h"
Index: dlls/oleaut32/variant.c
===================================================================
RCS file: /var/cvs/wine/dlls/oleaut32/variant.c,v
retrieving revision 1.98
diff -u -r1.98 variant.c
--- dlls/oleaut32/variant.c	4 Jul 2004 00:09:11 -0000	1.98
+++ dlls/oleaut32/variant.c	10 Aug 2004 21:51:54 -0000
@@ -28,8 +28,10 @@
 #include <stdlib.h>
 #include <stdarg.h>

+#define COBJMACROS
 #define NONAMELESSUNION
 #define NONAMELESSSTRUCT
+
 #include "windef.h"
 #include "winbase.h"
 #include "oleauto.h"
Index: dlls/oleaut32/vartype.c
===================================================================
RCS file: /var/cvs/wine/dlls/oleaut32/vartype.c,v
retrieving revision 1.9
diff -u -r1.9 vartype.c
--- dlls/oleaut32/vartype.c	4 Jul 2004 00:09:11 -0000	1.9
+++ dlls/oleaut32/vartype.c	10 Aug 2004 22:17:29 -0000
@@ -17,8 +17,11 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+
+#define COBJMACROS
 #define NONAMELESSUNION
 #define NONAMELESSSTRUCT
+
 #include "wine/debug.h"
 #include "wine/unicode.h"
 #include "winbase.h"
Index: dlls/oleaut32/tests/olefont.c
===================================================================
RCS file: /var/cvs/wine/dlls/oleaut32/tests/olefont.c,v
retrieving revision 1.4
diff -u -r1.4 olefont.c
--- dlls/oleaut32/tests/olefont.c	17 Mar 2004 20:47:42 -0000	1.4
+++ dlls/oleaut32/tests/olefont.c	10 Aug 2004 14:48:54 -0000
@@ -36,6 +36,7 @@
 #include <winnt.h>

 #include <wtypes.h>
+#define COBJMACROS
 #include <olectl.h>

 static HMODULE hOleaut32;
Index: dlls/shell32/shlview.c
===================================================================
RCS file: /var/cvs/wine/dlls/shell32/shlview.c,v
retrieving revision 1.97
diff -u -r1.97 shlview.c
--- dlls/shell32/shlview.c	4 Aug 2004 18:16:27 -0000	1.97
+++ dlls/shell32/shlview.c	10 Aug 2004 21:52:21 -0000
@@ -43,8 +43,10 @@
 #include <stdlib.h>
 #include <string.h>

+#define COBJMACROS
 #define NONAMELESSUNION
 #define NONAMELESSSTRUCT
+
 #include "windef.h"
 #include "winerror.h"
 #include "winbase.h"
Index: dlls/shlwapi/ordinal.c
===================================================================
RCS file: /var/cvs/wine/dlls/shlwapi/ordinal.c,v
retrieving revision 1.90
diff -u -r1.90 ordinal.c
--- dlls/shlwapi/ordinal.c	17 Jul 2004 00:05:23 -0000	1.90
+++ dlls/shlwapi/ordinal.c	10 Aug 2004 22:18:45 -0000
@@ -28,8 +28,10 @@
 #include <stdio.h>
 #include <string.h>

+#define COBJMACROS
 #define NONAMELESSUNION
 #define NONAMELESSSTRUCT
+
 #include "windef.h"
 #include "winbase.h"
 #include "winuser.h"
Index: dlls/urlmon/tests/url.c
===================================================================
RCS file: /var/cvs/wine/dlls/urlmon/tests/url.c,v
retrieving revision 1.1
diff -u -r1.1 url.c
--- dlls/urlmon/tests/url.c	3 May 2004 20:07:03 -0000	1.1
+++ dlls/urlmon/tests/url.c	10 Aug 2004 22:38:20 -0000
@@ -19,6 +19,9 @@
  */

 #include <stdarg.h>
+
+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "urlmon.h"
Index: tools/widl/header.c
===================================================================
RCS file: /var/cvs/wine/tools/widl/header.c,v
retrieving revision 1.22
diff -u -r1.22 header.c
--- tools/widl/header.c	22 Apr 2004 03:40:01 -0000	1.22
+++ tools/widl/header.c	10 Aug 2004 14:49:13 -0000
@@ -773,7 +773,9 @@
   indentation--;
   fprintf(header, "};\n");
   fprintf(header, "\n");
+  fprintf(header, "#ifdef COBJMACROS\n");
   write_method_macro(iface, iface->name);
+  fprintf(header, "#endif\n");
   fprintf(header, "\n");
   fprintf(header, "#endif\n");
   fprintf(header, "\n");



-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
                Linux: It is now safe to turn on your computer.



More information about the wine-patches mailing list