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

Improve ffi::specialize_for #11

Open
uselessgoddess opened this issue Aug 16, 2022 · 1 comment
Open

Improve ffi::specialize_for #11

uselessgoddess opened this issue Aug 16, 2022 · 1 comment
Labels
FFI:Attributes FFI: attributes for generating specializations

Comments

@uselessgoddess
Copy link
Member

uselessgoddess commented Aug 16, 2022

Now the specialization for all integer types looks like this:

#[ffi::specialize_for(
    types = "u8",
    types = "u16",
    types = "u32",
    types = "u64",
    convention = "rust",
    name = "doublets_constants_*"
)]

I see two ways of development:

1. Remove convention and add explicit annotation with more luxury style:

#[ffi::specialize_for(
    types(
        u8  => "u8",
        u16 => "uint16",
        u32 => "uint",
        u64 => "ll",
    )
    name = "doublets_constants_*"
)]
#[ffi::specialize_for(
    u8(u8), u16(uint16), u32(uint), u64(ll),
    name = "doublets_constants_*"
)]

2. Use a more limited solution with embedded annotations:

#[ffi::specialize("doublets_constants_*")]
@uselessgoddess uselessgoddess added the FFI:Attributes FFI: attributes for generating specializations label Aug 16, 2022
@uselessgoddess
Copy link
Member Author

Improve in #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FFI:Attributes FFI: attributes for generating specializations
Projects
None yet
Development

No branches or pull requests

1 participant