Skip to content
New issue

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

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

Already on GitHub? # to your account

C-Api cannot be built for 32bit targets #5303

Closed
ubamrein opened this issue Dec 13, 2024 · 1 comment · Fixed by #5306
Closed

C-Api cannot be built for 32bit targets #5303

ubamrein opened this issue Dec 13, 2024 · 1 comment · Fixed by #5306

Comments

@ubamrein
Copy link
Contributor

We tried to get the c-api backends to run/build on iOS/Android and found an issue on 32bit build-targets.
The following line fails to build on 32bit targets due to a overflow error (default integer type on 32bit targets is i32):

        if self.inner.map.len() >= 1 << 32 {

Casting both sides to u64 solves the issue, and probably is also what is expected here. A problem would only arise for targets where usize uses more than 64bit, which as far as I know, does not exist yet.

We patched it on our fork, and I'm glad to make a pull request if you approve of this fix. Otherwise we are open for discussion:
fffca20

@syrusakbary
Copy link
Member

I think the fix is sensitive, so we could be good to go here

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants