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

Prefix FFI callback function and struct names with the crate name #2220

Open
bendk opened this issue Aug 20, 2024 · 0 comments
Open

Prefix FFI callback function and struct names with the crate name #2220

bendk opened this issue Aug 20, 2024 · 0 comments

Comments

@bendk
Copy link
Contributor

bendk commented Aug 20, 2024

We do this for FFI functions, but we don't do it for structs or callback function types. This could lead to name collisions if two crates export traits with the same name.

UniFFI structs / callback functions that are always defined like ForeignFuture and ForeignFutureFree should not be prefixed IMO. It's cleaner to have a single definition of those. This maybe means we need to continue using if-guards like swift does, or maybe we could implement a method that combines/dedups the FFI definitions from multiple ComponentInterface instances.

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

No branches or pull requests

1 participant