Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Riddle dialects #2586

Merged
merged 6 commits into from Jul 25, 2023
Merged

Riddle dialects #2586

merged 6 commits into from Jul 25, 2023

Conversation

kennykerr
Copy link
Collaborator

Although windows-rs harmonizes the differences between Win32 and WinRT types, they are encoded somewhat differently in .winmd files and have different type system constraints. In order to simplify the syntax of .rdl files, they will now require a file-level attribute to indicate whether to interpret the file as containing Win32 or WinRT types.

You can use either #![win32] or #![winrt] at the top of the file. For example, this .rdl file defines the Test.Type struct as a WinRT types:

#![winrt]

mod Test {
    struct Type {
        field: i32,
    }
}

You can then use riddle to generate a .winmd and the struct will be encoded as a WinRT type or you can use riddle to generate Rust bindings and again the Rust bindings will use WinRT type semantics.

When generating .rdl files, riddle requires the TYPE configuration value set to either win32 or winrt and it will generate a .rdl file containing only types from the applicable type system.

@kennykerr kennykerr changed the title Riddle dialect Riddle dialects Jul 25, 2023
@kennykerr kennykerr merged commit a20dbba into master Jul 25, 2023
47 checks passed
@kennykerr kennykerr deleted the riddle branch July 25, 2023 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant