Declaration type names prefer unqualified names whereas reference type
names prefer fully qualified names.
This makes C++ code use fully qualified names when referencing a type,
fixing cases where types from other namespaces are used. It also allows
to skip the enum / struct / union type prefix in WinRT C++ code.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
MIDL generates enum typedefs without a prior type declaration, as well
as using explicit enum underlying type specifier. None of this is
supported in MinGW.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Or any interfaces, as long as they have a static factory, as MIDL
requires.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This generates additional macros to help keeping implementation simple,
guarded with WIDL_using ifdefs, like this:
#ifdef WIDL_using_Windows_Foo
#define IFooVtbl __x_ABI_CWindows_CFoo_CIFooVtbl
#define IFoo __x_ABI_CWindows_CFoo_CIFoo
#define IFoo_DoFoo __x_ABI_CWindows_CFoo_CIFoo_DoFoo
#endif /* WIDL_using_Windows_Foo */
Implementation files can define the desired WIDL_using preprocessor
macros before including the header, and then implement or use the
interface methods with the simple non-prefixed names instead.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
MinGW g++ requires initialized selectany to have extern linkage.
Also, because of the various ways WCHAR may be defined, using an array
initializer is the simplest way to support all cases.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Based on a patch from Steve Lhomme.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Based on a patch from Steve Lhomme.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Based on a patch from Steve Lhomme.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This is what MIDL does and avoid mismatching and even fixes some compiling issues.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This allows parameterized interfaces to be instanciated in declare
blocks, in the same way MIDL does, generating a new interface to the
header from the parameterized type template, replacing its parameters
with the given types.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
And add IVectorView<T> and IIterator<T> parameterized interfaces to
windows.foundation.idl for illustration and future use. They won't
generate any additional code until they are fully specialized.
This is a WIDL-specific feature, but MIDL has some magic knowledge of
these Windows.Foundation.Collections interface templates, and we need a
way to instruct WIDL about them too.
Having these interfaces declared in the IDL, guarded with __WIDL__ ifdef
is easier and more flexible than re-creating the types by hand in WIDL
source.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
For types under a non-global namespace.
MIDL generates prefixed mangled name for every use of enum, struct and
union types. When the types are in the global namespace, the typedef
name is used instead.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This function lacks a declaration in header.h and isn't used
outside of this source file.
This fixes warnings about missing a prototype, when built as part
of mingw-w64-tools (where it is built with -Wmissing-prototypes).
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Based on a patch by Richard Pospesel.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47149
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This is actually broken in MIDL, even as recent as the version shipped with
the Windows 10 SDK, but it makes our code simpler, so there's no reason not
to do it right.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This makes it easier to use header files generated by widl without
Windows headers.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>