<br><br>On Friday, 6 November 2015, Dmitry Timoshkov <<a href="mailto:dmitry@baikal.ru">dmitry@baikal.ru</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nikolay Sivov <<a href="javascript:;" onclick="_e(event, 'cvml', 'bunglehead@gmail.com')">bunglehead@gmail.com</a>> wrote:<br>
<br>
> > Nikolay Sivov <<a href="javascript:;" onclick="_e(event, 'cvml', 'bunglehead@gmail.com')">bunglehead@gmail.com</a> <javascript:;>> wrote:<br>
> ><br>
> > > > This matches midl/PSDK syntax, and allows to use Wine headers for<br>
> > compiling<br>
> > > > applications with a C++ win32/win64 compiler. In order to be usable by<br>
> > C++<br>
> > > > unix compilers widl needs to emit appropriate statically initialized<br>
> > WCHAR<br>
> > > > strings, but that's a different problem, currently the generated Wine<br>
> > headers<br>
> > > > with default(BSTR) statements can't be used with C++ at all.<br>
> > > ><br>
> > ><br>
> > > Where do you see this? Mshtml.idl from Windows 10 SDK doesn't use this<br>
> > > notation, and in fact only fsrm*.idl files do, so it's not a common<br>
> > > practice.<br>
> ><br>
> > midl has a built-in "magic" for handling defaultvalue() for BSTR strings,<br>
> > that's why PSDK headers are not consistent in that regard: some of them<br>
> > use defaultvalue("") while others use defaultvalue(L""). But using this<br>
> > magic is not necessary if the header uses appropriate type for the default<br>
> > value. So fixing an .idl should be preferrable IMO to adding support for<br>
> > magic behaviour to widl.<br>
><br>
> All headers except about 4 we don't have, use it like we do. All the magic<br>
> is to add a prefix during header generation, it doesn't look that hard, and<br>
> will get consistent result for idls that don't cone with wine.<br>
<br>
I don't really follow your objections. It's pretty clear that Wine .idl<br>
files with defaultvalue("") statements for BSTR type are broken. There<br>
are two ways to fix them:<br>
1) fix .idl files, widl and midl already have proper support for L"" syntax.<br>
2) don't fix .idl files (just because PSDK has them that way) and add magic<br>
handling for BSTR to widl.<br>
Fixing .idl files is a natural and easy fix, what syntax uses PSDK doesn't<br>
matter al all, it's even better to differ from PSDK headers in this case.</blockquote><div><br></div><div> Assigning static string in attempt to initialize BSTR is broken too of course. <span></span><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> > > Generated headers should use L"", like you said. But only in<br>
> > > case of empty strings.<br>
> ><br>
> > midl always generates L"" syntax, regardless whether it's an empty string<br>
> > or not.<br>
><br>
><br>
> I don't see this in mshtml.h when default value is not an empty string.<br>
<br>
Probably midl doesn't correctly handle even the magic that it's supposed to<br>
support. That just confirms that adding "magic" support for defaultvalue()<br>
to widl wouldn't solve the problem completely, and support for this "magic"<br>
would need adding even more magic to match midl brokeness.<br>
<br>
> > > Also leaving this broken for everything that's<br>
> > > not PSDK compiler doesn't sound right.<br>
> ><br>
> > mingw/borland/any other wine32 compiler also benefit from this change.<br>
> > It doesn't make sense to have it broken at all, but at least fixing<br>
> > the .idl side of breakage should be considered as the first step, and<br>
> > make the generated headers actually usable for the win32 platform.<br>
> ><br>
> > Since it only affects cpp case, that we don't use, how does it help<br>
> building wine?<br>
><br>
> And more importantly what will happen to gcc if you try to build with this<br>
> addition?<br>
<br>
gcc does build generated headers just fine. I wonder why you don't care what<br>
happens to gcc when it builds with current broken headers.<br>
<br></blockquote><div><br></div><div>Currently our headers don't have L"" strings, and we don't use it anywhere.  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
--<br>
Dmitry.<br>
</blockquote>