Skip to content

Fix type mismatch in ecs_lookup_symbol on ARM/Android platforms#286

Merged
Indra-db merged 2 commits intoIndra-db:mainfrom
Arion-Dsh:fix-arm-type-mismatch
Mar 31, 2026
Merged

Fix type mismatch in ecs_lookup_symbol on ARM/Android platforms#286
Indra-db merged 2 commits intoIndra-db:mainfrom
Arion-Dsh:fix-arm-type-mismatch

Conversation

@Arion-Dsh
Copy link
Copy Markdown
Contributor

On ARM platforms (such as Android or ARM Linux), c_char is typically defined as u8. The current implementation of World::import hardcodes a cast to *const i8 when calling sys::ecs_lookup_symbol:

let m = unsafe { sys::ecs_lookup_symbol(raw_world, symbol.as_ptr() as *const i8, true, false) };

This causes a compilation error because sys::ecs_lookup_symbol (generated by bindgen) expects *const c_char, which resolves to *const u8 on these platforms.

Changing the cast to as *const _ allows the compiler to infer the correct pointer type (*const i8 or *const u8) based on the platform-specific definition of c_char, making the code cross-platform compatible.

@Indra-db Indra-db merged commit e7464a8 into Indra-db:main Mar 31, 2026
11 checks passed
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

Successfully merging this pull request may close these issues.

2 participants