Commit ac509d8
committed
dxgi: Override enum (flags) ABI type to UINT when used in structures
Even though my previous contribution in #1757 added `AssociatedEnum`
annotations to both function parameters and structure fields for some
enum types, language bindings like windows-rs can only generate ABI
conversions for parameters (and return types) inside functions when
there's a mismatch (untyped enums are assumed to be `INT`, whereas
structures and functions usually use `UINT` instead of the enum name).
There is no place for this in `repr(C)` structs (in Rust), requiring
us to get more creative to use the original `UINT` ABI while still
replacing the field type with that of the relevant self-descriptive
enum type.
Instead, move these (also rather disconnected) annotations and
references on those enums and their respective fields to `enums.json`,
where we can set the `AssociatedEnum` attribute at once in a more
coherent way while above all allowing us to override the enum/flags
ABI type to match how it's used by the APIs in function parameters and
struct fields.1 parent 17452d6 commit ac509d8
File tree
3 files changed
+61
-21
lines changed- generation/WinSDK
- Partitions/Dxgi
- scripts
3 files changed
+61
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
54 | 61 | | |
55 | 62 | | |
56 | 63 | | |
| |||
1824 | 1831 | | |
1825 | 1832 | | |
1826 | 1833 | | |
1827 | | - | |
1828 | | - | |
1829 | | - | |
1830 | | - | |
1831 | | - | |
1832 | | - | |
1833 | | - | |
1834 | | - | |
1835 | | - | |
1836 | | - | |
1837 | | - | |
1838 | | - | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
1839 | 1839 | | |
1840 | 1840 | | |
1841 | 1841 | | |
1842 | 1842 | | |
| 1843 | + | |
1843 | 1844 | | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
1844 | 1849 | | |
1845 | 1850 | | |
1846 | 1851 | | |
1847 | 1852 | | |
| 1853 | + | |
1848 | 1854 | | |
1849 | 1855 | | |
| 1856 | + | |
| 1857 | + | |
1850 | 1858 | | |
1851 | 1859 | | |
1852 | 1860 | | |
| |||
1869 | 1877 | | |
1870 | 1878 | | |
1871 | 1879 | | |
1872 | | - | |
| 1880 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
0 commit comments