On Fri Oct 3, 2025 at 8:38 AM JST, Alistair Popple wrote: > On 2025-10-02 at 23:49 +1000, Alexandre Courbot <[email protected]> wrote... >> Hi Alistair, (+Benno as this concerns the `init!` macros) >> >> On Tue Sep 30, 2025 at 10:16 PM JST, Alistair Popple wrote: >> > Adds bindings and an in-place initialiser for the GspSystemInfo struct. >> > >> > Signed-off-by: Alistair Popple <[email protected]> >> > >> > --- >> > >> > It would be good to move to using the `init!` macros at some point, but >> > I couldn't figure out how to make that work to initialise an enum rather >> > than a struct as is required for the transparent representation. >> >> Indeed we have to jump through a few (minor) hoops. >> >> First the `init!` macros do not seem to support tuple structs. They >> match a `{` after the type name, which is not present in >> `GspSystemInfo`. By turning it into a regular struct with a single >> field, we can overcome this, and it doesn't affect the layout the >> `#[repr(transparent)]` can still be used. > > I was thinking we should fix the `init!` macro to support tuple structs. Is > there some fundamental reason `init!` couldn't be modified to support tuple > structs? It seems like it would be nicer to fix that limitation rather than > work > around it here.
I took a look at it and quickly got lost in the macros's internals. :) Let's see what Benno has to say about this. In the meantime, using a single member is just as valid a constructs as a tuple struct for us.
