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>
Otherwise we end up with types like ABI::IInspectable.
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>
This allows parameterized types to reference each other with a different
set of parameters. This is required for instance for IIterable<T>, that
needs to reference IIterator<T>.
The partial specialization is recorded by adding a new parameterized
type, referencing the original one as its template. The parameterized
type chain will be resolved all at once when the type is declared.
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 use it for format_namespace to grow buffer as needed.
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>
Do not overwrite explicitly stated paths, such as header_name or
proxy_name. Instead, use output_name when specified as a fallback.
Signed-off-by: Andrew Boyarshin <andrew.boyarshin@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
And split the dispinterface case, which is not supported in WinRT mode.
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>
MIDL WinRT mode only supports a limited subset of original IDL syntax
anyway, and this will save some conflicts when removing the lexer trick
for namespaces.
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>
Interface referencing should probably check for a previous type
declaration, but Wine IDLs currently have many places where this is
broken.
This is for instance the case when a coclass use the inner interface
statement to declare an interface without any previous declaration.
And in mimeole.idl, coclass are being declared with the same name as
their interface, to generate the corresponding CLSID.
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>
As an alias to free-threaded model.
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>
e.g. using the same kind of custdata in multiple interfaces
Signed-off-by: Kevin Puetz <PuetzKevinA@JohnDeere.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>
Some attributes can be specified multiple times, this is the case for
instance for "custom" attribute, as well as WinRT "static".
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: PuetzKevinA@JohnDeere.com
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Per standard, ctime already ends with '\n\0', so this doubled it.
Signed-off-by: Kevin Puetz <PuetzKevinA@JohnDeere.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Also fix uninitialized value in this field for TKIND_DISPATCH.
Signed-off-by: Kevin Puetz <PuetzKevinA@JohnDeere.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Interfaces are going to reference each other across namespaces, so this
implements a type lookup with the full name.
It supports the following idl syntax in WinRT mode:
#ifdef __WIDL__
#pragma winrt ns_prefix
#endif
import "wtypes.idl";
namespace Windows {
namespace Foo {
[object]
interface IFoo {}
}
namespace Bar {
[object]
interface IBar { HRESULT DoBar([in] Windows.Foo.IFoo *foo); }
}
}
That was previously failing to parse the Windows.Foo.IFoo part and to
lookup the corresponding type.
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>
This avoids a warning casting between calling conventions with Clang.
Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Otherwise widl crashes while generating a typelib for a structure
with an embedded anonymous union:
typedef struct _s
{
int type;
union
{
int f;
};
} s;
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Otherwise widl crashes while generating a typelib for
typedef struct _s
{
int type;
union
{
int field;
} u;
} s;
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>