fre, 2003-03-07 kl. 19:49 skrev Jon:
This patch addresses some issues with widl. After applying the patch all .idl files should be regenerated. These fixes are needed before my ocidl.idl can be added. The last two lines of the changelog aren't seen in the wild; I found them only when adding ocidl to my tree.
Could you explain the reason behind the last line, "Don't dump full struct/enum definitions in prototypes", since this shouldn't happen in any case. When a prototype is emitted, the parameter type is supposed to be defined, or not; if it's not defined, t->defined is FALSE, and if it's defined, t->written should be TRUE, either of which should lead to the "else" clause which doesn't dump the full struct/enum definition. If t->written isn't TRUE, why isn't it? (And if there's a good reason for it after all, it would be cleaner to say "if (t->defined && !t->written && structs)" instead of adding a new "if (structs)" inside)
There is one remaining bug in widl which I haven't yet tracked down; someone more knowledgable with widl may want to look at it:
If objidl.idl is compiled with '-b' but without '-h', the resulting header contains garbage ("[][][][][][][][][]" - generated by write_array() just after IPropertyStorage_Stat_Stub) in the generated header. With both flags (the default for Wine) however, the output is correct.
I thought I had fixed such occurrences. If your widl is properly recompiled, then I'm not sure why it happens.
Also, it would be nice if widl handled function pointers as method args...
I didn't think RPC supported this. The MS IDL I've seen just uses that cpp_quote #if 0 ... else trick to define structures with these, and I saw no need for widl to be smarter about it than MIDL is, considering that function pointers doesn't map cleanly to RPC anyway. Besides, it would be nice if our .idl files stayed compatible with MIDL.
Hi,
--- Ove Kaaven ovek@arcticnet.no wrote:
Could you explain the reason behind the last line, "Don't dump full struct/enum definitions in prototypes", since this shouldn't happen in any case.
The following idl file, "foo.idl", cut down from my oleidl.idl for example purposes:
--------------------------------- import "objidl.idl";
interface IOleClientSite; interface IOleObject;
typedef LPCRECT LPCBORDERWIDTHS;
[ object, uuid(00000112-0000-0000-C000-000000000046) ] interface IOleObject : IUnknown { typedef IOleObject* LPOLEOBJECT;
HRESULT DoVerb( [in] LONG iVerb, [in] struct tagMSG* lpmsg, [in] IOleClientSite* pActiveSite, [in] LONG lindex, [in] HWND hwndParent, [in] LPCRECT lprcPosRect); } ---------------------------------
Produces as its output when run with -b -h:
struct IOleObject: IUnknown { virtual HRESULT CALLBACK DoVerb( LONG iVerb, struct tagMSG { HWND hwnd; UINT message; WPARAM wParam; LPARAM lParam; DWORD time; POINT pt; }* lpmsg, IOleClientSite* pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect) = 0;
} ICOM_COM_INTERFACE_ATTRIBUTE;
The patch I sent fixes this problem; if you think theres a better way to fix it then let me know, I'll strip that change out and re-send just the other fixes.
I didn't think RPC supported this.
Fair enough, probably best left as it is then.
Cheers, Jon
===== "Don't wait for the seas to part, or messiahs to come; Don't you sit around and waste this chance..." - Live
jon_p_griffiths@yahoo.com
__________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com
lør, 2003-03-15 kl. 13:35 skrev Jon Griffiths:
Hi,
--- Ove Kaaven ovek@arcticnet.no wrote:
Could you explain the reason behind the last line, "Don't dump full struct/enum definitions in prototypes", since this shouldn't happen in any case.
The following idl file, "foo.idl", cut down from my oleidl.idl for example purposes:
import "objidl.idl";
interface IOleClientSite; interface IOleObject;
typedef LPCRECT LPCBORDERWIDTHS;
[ object, uuid(00000112-0000-0000-C000-000000000046) ] interface IOleObject : IUnknown { typedef IOleObject* LPOLEOBJECT;
HRESULT DoVerb( [in] LONG iVerb, [in] struct tagMSG* lpmsg, [in] IOleClientSite* pActiveSite, [in] LONG lindex, [in] HWND hwndParent, [in] LPCRECT lprcPosRect); }
Produces as its output when run with -b -h:
struct IOleObject: IUnknown { virtual HRESULT CALLBACK DoVerb( LONG iVerb, struct tagMSG { HWND hwnd; UINT message; WPARAM wParam; LPARAM lParam; DWORD time; POINT pt; }* lpmsg, IOleClientSite* pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect) = 0;
} ICOM_COM_INTERFACE_ATTRIBUTE;
Oh I see now... struct tagMSG is defined in an imported idl file so it won't be written out while processing ocidl, and thus t->written remains FALSE even though it's properly defined. The best way to solve this would still be to ensure that t->written is TRUE, by changing the parser.y line
if (!parse_only) write_typedef($$, $4);
into something that will still set the "written" field of the type (and its embedded structures) even if parse_only is true (and similarly with the enumdefs, structdefs, uniondefs, and interfacedefs, probably). A new parameter to write_type/write_typedef which inhibits writing anything to the header but still sets "written", for example... would that work?
Hi,
--- Ove Kaaven ovek@arcticnet.no wrote:
A new parameter to write_type/write_typedef which inhibits writing anything to the header but still sets "written", for example... would that work?
Err, probably, but I'm not convinced its a better solution without going back through the code again (I made those changes over a month ago). I'll resubmit the other two fixes and look at it again when my current batch of oleaut32 things are wrapped up. I only came accross this bug trying to add IRecordInfo for the SafeArray/Variant functions I wanted to implement, so I've wandered quite far from my original path already...
Cheers, Jon
===== "Don't wait for the seas to part, or messiahs to come; Don't you sit around and waste this chance..." - Live
jon_p_griffiths@yahoo.com
__________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com
tir, 2003-03-18 kl. 08:39 skrev Jon Griffiths:
Hi,
--- Ove Kaaven ovek@arcticnet.no wrote:
A new parameter to write_type/write_typedef which inhibits writing anything to the header but still sets "written", for example... would that work?
Err, probably, but I'm not convinced its a better solution without going back through the code again (I made those changes over a month ago).
I think it is. Consider:
file1.idl: typedef struct tagSTRCT { int a; } STRCT;
file2.idl: import "file1.idl" typedef struct tagSTRCT *LPSTRCT;
Without my solution, we'd get
file2.h: #include "file1.h" typedef struct tagSTRCT { int a; } *LPSTRCT;
which would be a struct redefinition.
I'll resubmit the other two fixes and look at it again when my current batch of oleaut32 things are wrapped up. I only came accross this bug trying to add IRecordInfo for the SafeArray/Variant functions I wanted to implement, so I've wandered quite far from my original path already...
OK.