Commit graph

1452 commits

Author SHA1 Message Date
Alexandre Julliard ae8797c8e3 tools: Add a common helper to setup signal handlers. 2023-01-25 11:47:51 +01:00
Alexandre Julliard ca398e2762 tools: Add a common helper to cleanup temp files. 2023-01-25 11:47:51 +01:00
Alexandre Julliard ecb651c01f tools: Add a common helper to get the argv0 directory. 2023-01-25 11:47:51 +01:00
Alexandre Julliard 6f123e8424 tools: Always fall back to argv[0] to find the tools directory.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54319
2023-01-16 22:08:43 +01:00
Alexandre Julliard bdc40b4b60 tools: Create a temporary directory to store temp files. 2023-01-12 14:47:39 +01:00
Alexandre Julliard 6a91264918 makefiles: Store PE objects in subdirectories in the build tree.
This will make it possible to build multiple PE architectures.
2022-10-26 15:03:05 +02:00
Michael Stefaniuc 7029bba31a widl: Use ARRAY_SIZE instead of open coding it. 2022-10-25 10:59:05 +02:00
Zebediah Figura e654b631f2 widl: Generate "static inline" instead of "static FORCEINLINE" for COM inline wrappers.
mingw-w64 defines __forceinline (and therefore FORCEINLINE) as
"extern __inline__ __attribute__((__always_inline__,__gnu_inline__)). This means
that COM inline wrappers specify multiple storage classes and hence cannot be
compiled.

Wine defines FORCEINLINE simply as "inline" (and uses "static" everywhere), so
this is a non-issue for Wine. However, since Wine and mingw-w64 share the source
code of widl and of most IDL headers, this patch changes the definition for both
projects.

There's no reason to force inlining here, especially since the wrappers need to
be manually enabled, and we don't need to match PSDK semantics where these
wrappers don't even exist.

In practice, use "__inline__" instead of "inline" for GNU C targets, to preserve
compatibility with C89 in mingw-w64 headers.
2022-09-28 15:27:51 +02:00
Julian Klemann c8c7ff640a widl: Use "cinterface(IInspectable)" for IInspectable signature.
Fixes the UUID of ITypedEventHandler<DeviceWatcher*, IInspectable*> to
match MIDL.
2022-09-14 22:38:34 +02:00
Rémi Bernon de95ee6c66 widl: Allow parameterized types in runtimeclass interfaces. 2022-09-13 16:22:21 +02:00
Rémi Bernon 837297c21f widl: Support namespaces for union declarations.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-07-07 19:10:02 +02:00
Rémi Bernon 25e1fb45db widl: Fix missing support for struct / union parameterized type replacement.
And we can just pass them through, as with other class types. This
fixes widl not accepting EventRegistrationToken method argument type
in a parameterized type.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-07-07 19:10:02 +02:00
Rémi Bernon d81589371d widl: Remove set but unused variable.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-25 11:58:57 +02:00
Alexandre Julliard 88dcdbdcc6 widl: Silence error message for unknown languages.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-01 20:30:57 +02:00
Alistair Leslie-Hughes 3f942a32c3 widl: Support basic BYTE type.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-04 10:01:32 +01:00
Bernhard Kölbl 6555201716 widl: Allow multiple uses of the activatable attribute.
Signed-off-by: Bernhard Kölbl <besentv@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-02 20:17:25 +01:00
Rémi Bernon 3e16b37475 widl: Support declaring multiple namespaces at once.
Using the namespace A.B.C {} syntax, used in a few some places in WinRT
IDLs.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-22 18:20:22 +01:00
Alexandre Julliard 62f9bd39a2 tools: Consistently use xmalloc/xrealloc/xstrdup everywhere.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-08 20:24:14 +01:00
Rémi Bernon 21fa9fa36a widl: Fix sign handling in parameterized types signatures.
Unspecified sign should be mapped to signed integer / char.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-25 20:50:49 +01:00
Rémi Bernon 1af44e2670 widl: Use "string" for HSTRING in signatures for generated UUID.
Fixes the UUID of IVectorView<HSTRING*> to match MIDL for instance.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-25 20:50:49 +01:00
Rémi Bernon 1f2614c60b widl: Fix nested parameterized types C / short name output.
We append type->name from each parameter when constructing the c_name
of parameterized type. When the parameter is itself a parameterized type
this field contains C++-like name, with template brackets.

Instead this precomputes the names of parameterized types whenever they
are used as a parameter. In this case the format is the same as the C
name, except that __C is used as a namespace separator, instead of _C,
and that there's no namespace or abi prefix included.

Shorthands need to be applied too, altough they have to match the __C.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-25 20:50:49 +01:00
Rémi Bernon b2a1e381d8 widl: Clarify declaration type names vs (reference) type names.
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>
2022-01-25 20:50:49 +01:00
Rémi Bernon 86c565cf0e widl: Do not generate C++ enum typedefs in WinRT mode.
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>
2022-01-25 20:50:49 +01:00
Bernhard Kölbl 64d5feb4ce widl: Add support for the [overload] attribute.
The attribute is used by WinRT and doesn't have any
effect on the generated headers.

Signed-off-by: Bernhard Kölbl <besentv@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-25 20:50:49 +01:00
Huw Davies f8adbf35ca widl: Remove the uuid_t typedef which causes conflicts on macOS.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-25 09:27:15 +01:00
Alexandre Julliard a7f0e61e6c widl: Avoid using Windows types where possible.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-24 12:27:47 +01:00
Bernhard Kölbl 22d27236ce widl: Allow optional interface parameter on the [activatable] attribute.
As per MIDL 3.0. Needed for some WinRT runtime classes.

Signed-off-by: Bernhard Kölbl <besentv@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-24 10:10:52 +01:00
Alexandre Julliard c09a5da157 wrc: Add a workaround for older bison versions.
Bison < 3.6 doesn't apply api.prefix to YYEMPTY.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-21 23:38:08 +01:00
Alexandre Julliard f4af3134de makefiles: Specify the bison prefix directly in the source files.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-21 13:15:12 +01:00
Alexandre Julliard 49326cb258 tools: Use flush_output_buffer() in a few more places.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 10:55:08 +01:00
Martin Storsjö 7f95c69299 widl: Fix including tlb files in mingw-w64-tools configuration.
Prior to c94f44f9b4 (widl: Search for
imported typelibs in the library search path.), widl looked for
tlb files in the path specified by BIN_TO_INCLUDEDIR. After that
commit, widl looks for tlb files in a subdirectory (get_pe_dir)
of BIN_TO_DLLDIR (which mingw-w64 sets to the same as
BIN_TO_INCLUDEDIR).

For compatibility with the mingw-w64 usecase, check for tlb files
in the directory specified by BIN_TO_DLLDIR without a separate
subdirectory suffix too.

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-29 13:44:03 +01:00
Alexandre Julliard b53773cff2 tools: Move the output buffer functions to the common header.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-10 22:00:17 +01:00
Alexandre Julliard 13ec7952e0 configure: Assume that unistd.h is available on Unix.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 18:43:51 +01:00
Alexandre Julliard 8d6c33c3bf include: Remove wine/port.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Alexandre Julliard 62d335053f makefiles: Don't append .fake extension to fake dlls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-20 13:07:47 +01:00
Alexandre Julliard d969d02e21 tools: Move target CPU and platform handling to the common tools.h header.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-18 11:50:30 +01:00
Alexandre Julliard c70ed78a36 widl: Get rid of PowerPC support.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-18 11:16:21 +01:00
Alexandre Julliard 04d8725080 makefiles: Directly generate resources also for non-registered typelibs.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-16 10:22:51 +01:00
Alexandre Julliard c94f44f9b4 widl: Search for imported typelibs in the library search path.
Add a -L option to specify that path.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-12 22:42:51 +01:00
Alexandre Julliard ae44ba97b0 widl: Support loading typelibs stored inside PE files.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49803
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-12 15:49:50 +01:00
Alexandre Julliard 4f0bb2e45f wrc: Support only single directories with the -I option.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-12 11:40:15 +01:00
Alexandre Julliard ad53edfab9 widl: Windows file formats are always little-endian.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-11 17:50:24 +01:00
Damjan Jovanovic 6d67748154 widl: Use sysctl instead of /proc/curproc/file on FreeBSD.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-25 18:50:59 +02:00
Alexandre Julliard f9ee0d2f05 tools: Avoid using wine/port.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 18:03:11 +02:00
Alexandre Julliard 207068c48c tools: Move some portability defines out of port.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Alexandre Julliard 4bc52e3324 widl: Avoid using getopt_long().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:53:08 +02:00
Nikolay Sivov 73686845d1 widl: Allow [hidden] and [version] on modules.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-04 15:49:59 +02:00
Nikolay Sivov e3893d6bfd widl: Allow modules without attributes.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-04 15:49:57 +02:00
Alexandre Julliard dbe7e12b54 widl: Use a string array for the filenames list.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-29 21:38:11 +02:00
Alexandre Julliard 9e3959bd9b tools: Add a few helper functions for file names and extensions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-29 21:38:11 +02:00
Alexandre Julliard 55701c6672 tools: Add a helper function to create temp files.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-29 21:38:11 +02:00
Alexandre Julliard 97ca9f8a3d tools: Add a shared header for common helper functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-28 17:38:06 +02:00
Alexandre Julliard b69ce3472d wpp: Move the preprocessor code into wrc.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-24 21:55:18 +02:00
Nikolay Sivov 23cbb01c0e widl: Remove arguments from writing calls that don't use them (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 21:41:30 +02:00
Nikolay Sivov ec9892585e widl: Write default values for VARIANT arguments.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-08 20:39:58 +02:00
Martin Storsjo 57433856b4 widl: Pick up the target arch from a prefix on argv[0].
If the executable is named <target>-widl, try to pick up the target
arch implicitly from there.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 17:42:15 +02:00
Martin Storsjo 4766a01818 widl: Allow switching between 32 and 64 bit ARM with the -m32/64 option.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 17:42:14 +02:00
Rémi Bernon 2a7940c97d widl: Generate typedefs for namespaced struct / enum 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>
2021-03-23 20:58:45 +01:00
Rémi Bernon aa119a1e06 widl: Always check the runtimeclass interfaces presence.
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>
2021-03-19 19:55:34 +01:00
Rémi Bernon 7f9143143f widl: Only register activatable WinRT runtimeclass.
Or with a static factory, as Windows.Input.Gamepad for instance.

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>
2021-03-17 15:36:48 +01:00
Rémi Bernon e137becb13 widl: Allow runtimeclass to not have a default interface.
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>
2021-03-10 18:43:15 +01:00
Rémi Bernon 31af1aeb78 widl: Add support for WinRT regscript generation.
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>
2021-03-04 21:53:53 +01:00
Rémi Bernon 4b24b6be06 widl: Fix missing delegate declaration namespace.
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>
2021-03-02 20:39:48 +01:00
Nikolay Sivov 4b2930d3f1 widl: Remove unnecessary assignment (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-01 10:12:54 +01:00
Rémi Bernon dc65f88654 widl: Generate helper macros for WinRT implementation.
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>
2021-02-26 16:25:57 +01:00
Rémi Bernon 5f6fdb1838 widl: Strip last separator in append_namespaces if suffix is NULL.
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>
2021-02-26 16:25:55 +01:00
Rémi Bernon 31cbca5f07 widl: Make WinRT nested templates C++98 compatible.
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>
2021-02-26 16:25:51 +01:00
Rémi Bernon 6966d7ea08 widl: Fix C++ RuntimeClass string constants declaration.
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>
2021-02-26 16:25:41 +01:00
Rémi Bernon 41a3087394 widl: Use C++ template implementation for parameterized types.
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>
2021-02-25 22:39:21 +01:00
Rémi Bernon 3556ecd5d7 widl: Write C++ template implementations for parameterized types.
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>
2021-02-25 22:39:21 +01:00
Rémi Bernon ea9d98082a widl: Write C++ template declarations for parameterized types.
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>
2021-02-25 22:39:21 +01:00
Steve Lhomme 49a1cc10d2 widl: Use C name when writing UUID declarations.
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>
2021-02-19 23:46:30 +01:00
Steve Lhomme 18f04f569b widl: Define the C type name as an alias for the C++ qualified name.
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>
2021-02-19 23:46:30 +01:00
Steve Lhomme fc533ddf32 widl: Precompute qualified type names, and use them for C++ interfaces.
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>
2021-02-19 23:46:30 +01:00
Steve Lhomme a78053743d widl: Never use the namespace ABI prefix for global types.
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>
2021-02-19 23:46:30 +01:00
Rémi Bernon b1e9326f5a widl: Compute uuids for parameterized 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>
2021-02-18 22:39:33 +01:00
Rémi Bernon c5413e1258 widl: Compute signatures for parameterized 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>
2021-02-18 22:39:33 +01:00
Rémi Bernon fecfd245a1 widl: Support WinRT parameterized delegate type.
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>
2021-02-18 22:39:33 +01:00
Rémi Bernon 2326d7226d widl: Support WinRT delegate type.
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>
2021-02-18 22:39:33 +01:00
Rémi Bernon d3c7aa2915 widl: Support WinRT parameterized interface type.
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>
2021-02-17 22:21:06 +01:00
Rémi Bernon d5bf8f4e8a widl: Support partially specialized parameterized type.
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>
2021-02-17 21:42:18 +01:00
Rémi Bernon 94b5af4b34 widl: Replace type_list_t with typeref_list_t.
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>
2021-02-17 21:42:18 +01:00
Rémi Bernon 84966c9b59 widl: Rename ifref_list_t to typeref_list_t.
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>
2021-02-17 21:42:18 +01:00
Rémi Bernon 7987c6f9ba widl: Rename ifref_t to typeref_t.
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>
2021-02-17 21:42:18 +01:00
Rémi Bernon db580fe9db widl: Rename ifref_t iface member to type.
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>
2021-02-17 21:42:18 +01:00
Andrew Boyarshin a55a37d1da widl: Support midl_pragma default option.
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>
2021-02-16 23:01:38 +01:00
Rémi Bernon 6341546fde widl: Introduce new strappend helper.
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>
2021-02-12 14:46:32 +01:00
Rémi Bernon ed21c29481 widl: Support WinRT parameterized type parsing.
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>
2021-02-12 14:46:29 +01:00
Andrew Boyarshin 5423e0d9e6 widl: Fix handling of output_name in option parsing.
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>
2021-02-09 21:16:34 +01:00
Rémi Bernon daba929a52 widl: Support WinRT requires keyword.
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>
2021-02-09 21:16:16 +01:00
Rémi Bernon 1442ddf942 widl: Support WinRT static attribute parsing.
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>
2021-02-09 21:16:14 +01:00
Rémi Bernon 30129c2837 widl: Support WinRT activatable attribute parsing.
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>
2021-02-09 21:16:11 +01:00
Timothy Pearson fe723c2673 widl: Add PPC64 support.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-09 13:03:47 +01:00
Rémi Bernon 2bfcfcc0a9 widl: Support referencing qualified interface names.
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>
2021-02-08 20:09:21 +01:00
Rémi Bernon 509daf4d23 widl: Fold inherit cases by using typename rule in qualified_type.
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>
2021-02-08 20:09:19 +01:00
Rémi Bernon 374321f836 widl: Remove aNAMESPACE token from the lexer.
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>
2021-02-08 20:09:15 +01:00
Rémi Bernon f5b7a76b28 widl: Disallow qualified types in expressions.
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>
2021-02-08 20:09:12 +01:00
Rémi Bernon 47a256c648 widl: Use explicit namespace parameter for qualified names.
Instead of buggy lookup namespace stack.

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>
2021-02-08 20:09:07 +01:00
Rémi Bernon f76f3d152f widl: Add explicit namespace parameter to find_type_or_error.
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>
2021-02-08 20:09:04 +01:00
Rémi Bernon 36597eda3d widl: Fold aIDENTIFIER / aKNOWNTYPE rules together.
Splitting t_ident rule as typename / m_typename rules.

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>
2021-02-05 22:53:46 +01:00