Francois Gouget wrote:

>    Yes, there is a problem with a change I made recently. There's been
> some discussion about it during this weekend already.
>    Maybe the best for you is to revert back to an old version of
> 'include/wine/obj_base.h' (or switch to gcc 2.95) while I try to sort it
> out with the help from gcc guys.
>
>    BTW, the compiler you're using is even more recent than the one
> shipped with Redhat 7, right?
>

Francois,

I believe the attached patch^H^H^H^H^Hhack will "fix" the problem.

As I understand it you wish the function name to be passed to
ICOM_METHOD???(...) unexpanded and you also wish it to be passed to ICOM_FN
(within the ICOM_METHOD??? macro) unexpanded.  In the ICOM_FN macro you prepend
"fn" to it using the token pasting operator when __WINE__ is defined.  If
__WINE__ is not defined you leave it unaltered.  After this I am assuming you
WANT it expanded if it should be (i.e. fn was not prepended to it).

The attached patch simply saves the value of the misbehaving macro to a
temporary macro, undefines the macro, does what needs to be done, redefines the
macro using the temporary macro then undefines the temporary macro.  It only
does this in the __WINE__ case so that it still gets expanded for winelib.

I did not remove the (##xfn stuff as it only generates warnings which
IMHO should be there as they indicate a broken preprocessor.

Have a good one,
-Dave
Index: include/wine/obj_control.h
===================================================================
RCS file: /home/wine/wine/include/wine/obj_control.h,v
retrieving revision 1.10
diff -u -r1.10 obj_control.h
--- include/wine/obj_control.h  2000/09/26 00:01:00     1.10
+++ include/wine/obj_control.h  2001/01/02 10:14:35
@@ -408,12 +408,25 @@
 /*****************************************************************************
  * IProvideClassInfo interface
  */
+#ifdef __WINE__
+#ifdef GetClassInfo
+#define TEMPMACRO_GetClassInfo GetClassInfo
+#undef GetClassInfo
+#endif /* #ifdef GetClassInfo */
+#endif /* #ifdef __WINE__ */
+
 #define ICOM_INTERFACE IProvideClassInfo
 #define IProvideClassInfo_METHODS \
        ICOM_METHOD1(HRESULT,GetClassInfo, ITypeInfo**,ppTI) 
 #define IProvideClassInfo_IMETHODS \
        IUnknown_IMETHODS \
        IProvideClassInfo_METHODS
+#ifdef __WINE__
+#ifdef TEMPMACRO_GetClassInfo
+#define GetClassInfo TEMPMACRO_GetClassInfo
+#undef TEMPMACRO_GetClassInfo
+#endif /* #ifdef TEMPMACRO_GetClassInfo */
+#endif /* #ifdef __WINE__ */
 ICOM_DEFINE(IProvideClassInfo,IUnknown)
 #undef ICOM_INTERFACE
 
Index: include/wine/obj_moniker.h
===================================================================
RCS file: /home/wine/wine/include/wine/obj_moniker.h,v
retrieving revision 1.15
diff -u -r1.15 obj_moniker.h
--- include/wine/obj_moniker.h  2000/09/26 00:01:00     1.15
+++ include/wine/obj_moniker.h  2001/01/02 10:14:36
@@ -298,6 +298,13 @@
 /*****************************************************************************
  * IRunningObjectTable interface
  */
+#ifdef __WINE__
+#ifdef GetObject
+#define TEMPMACRO_GetObject GetObject
+#undef GetObject
+#endif /* #ifdef GetObject */
+#endif /* #ifdef __WINE__ */
+
 #define ICOM_INTERFACE IRunningObjectTable
 #define IRunningObjectTable_METHODS \
     ICOM_METHOD4(HRESULT,Register,            DWORD,grfFlags, IUnknown*,punkObject, 
IMoniker*,pmkObjectName, DWORD*,pdwRegister) \
@@ -310,6 +317,12 @@
 #define IRunningObjectTable_IMETHODS \
     IUnknown_IMETHODS \
     IRunningObjectTable_METHODS
+#ifdef __WINE__
+#ifdef TEMPMACRO_GetObject
+#define GetObject TEMPMACRO_GetObject
+#undef TEMPMACRO_GetObject
+#endif /* #ifdef TEMPMACRO_GetObject */
+#endif /* #ifdef __WINE__ */
 ICOM_DEFINE(IRunningObjectTable,IUnknown)
 #undef ICOM_INTERFACE
 

Reply via email to