I have bindings in Rust for a library in C and they aren't complete.
In C code I have a macros defined, simplified, like this:
#define MY_MACROS1(PTR) (((my_struct1 *) (PTR))->field1.field2 >> 2)
I need to achieve the same thing in Rust.
I have a Rust binding definition for my_struct1. And I have a pointer
let my_ptr1: usize = unsafe { get_a_pointer_from_c(); }
How can I cast a pointer my_ptr1 to my_struct1 or rather to my_struct1 * ?
Rust binding to get_a_pointer_from_c() returns a pointer of type usize, note.