Juan Lang juan_lang@yahoo.com writes:
+#define DECL_IFACE(ifc) const I##ifc##Vtbl *lp##ifc##Vtbl;
+#define IFACE2IMPL(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp##ifc##Vtbl))) +#define IMPL2IFACE(ifc,x) ((I##ifc*)&(x)->lp##ifc##Vtbl)
Please avoid that sort of macros, it makes grepping for things a lot harder. Just spell things out explicitly, and for IFACE2IMPL define a couple of inline functions instead.
Am Montag 10 Juli 2006 12:24 schrieb Alexandre Julliard:
Juan Lang juan_lang@yahoo.com writes:
+#define DECL_IFACE(ifc) const I##ifc##Vtbl *lp##ifc##Vtbl;
+#define IFACE2IMPL(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp##ifc##Vtbl))) +#define IMPL2IFACE(ifc,x) ((I##ifc*)&(x)->lp##ifc##Vtbl)
Please avoid that sort of macros, it makes grepping for things a lot harder. Just spell things out explicitly, and for IFACE2IMPL define a couple of inline functions instead.
If I read the macros correctly they are for defining COM interfaces and casts from implementation pointer to interface pointer. DDraw has a couple of macros for that in dlls/ddraw/ddcomimpl.h, perhaps we should move this file to include/wine/?
Stefan Dösinger stefandoesinger@gmx.at writes:
If I read the macros correctly they are for defining COM interfaces and casts from implementation pointer to interface pointer. DDraw has a couple of macros for that in dlls/ddraw/ddcomimpl.h, perhaps we should move this file to include/wine/?
No, like I said we should avoid that sort of thing. Inline functions are much preferable. Look at dlls/shell32/shelllink.c for an example.