On 9/20/20 11:14 PM, Jacek Caban wrote: > On 20/09/2020 14:02, Liu Hao wrote: > >> 在 2020/9/20 19:45, Jean Pierre Cimalando 写道: >>> Le Sun, 20 Sep 2020 19:18:51 +0800, >>> Liu Hao <lh_mo...@126.com> a écrit : >>> >>>> It is now imported from Wine. Perhaps it's a necessary trade-off, >>>> because not having a suffix would cause errors in C. >>>> >>> The header has distinct interfaces for C and C++. >>> It's understandable that C requires to use unique names, however will >>> it be detrimental to modify code generation such that C++-only parts >>> would conform to the original naming? >>> >> I presume it is possible; even a naive `#if...#else...#endif` could >> resolve the issue. >> >> I would like to hear from Jacek first. > > > #if is problematic, because it would need to be in cpp_quote() and we > can't have those local to methods, so entire interfaces would need to > be duplicated in cpp_quote()s. > > > I think that we will need a widl extension. Maybe something like > cpp_override attribute, which would look like: > > [cpp_override(GetPropertyValues)] HRESULT GetPropertyValues_( /*... */); > > and use the name provided by the attribute in C++ declaration.
Maybe we could rename suffixed names back to back name in idls and then when duplicate is detected by widl do such branching for C++ vs C? That might need some CLI switch to allow duplicates in a first place for selected idl files. Also another aspect to it. The order of such methods in compiled code is reversed comparing to C++ definition. That relies on gcc being compatible with msvc compiler, or maybe that's standardized in C++ in which case please excuse my ignorance. > > > Jacek > > > > _______________________________________________ > Mingw-w64-public mailing list > Mingw-w64-public@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public