You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am converting code from C to rust.
There is too much code so the transition must be done in steps.
Some struct variables have the volatile modifier, so I have to find a way to generate struct variables with volatile to ensure the C code behaves the same during the transition and everything can be tested.
On the rust side volatile behavior is achieved by using read_volatile/write_volatile manually or with a wrapper.
On the C side the variables must have the volatile modifier or I must cast every singe use of the variable to a volatile type (untested).
I am looking for a solution that avoids having to modify the original C code.
The ideal solution would be cbindgen generating the volatile modifier in specific struct variables, which allows me to change the structure at a later stage while ensuring the remaining C code behaves the same.
So, how do I mark a struct variable volatile?
The text was updated successfully, but these errors were encountered:
after_includes = """// volatile types (cbindgen does not emit the C volatile type qualifier)typedef volatile int Volatile_c_int;typedef int *volatile Volatile_____c_int;"""
I am converting code from C to rust.
There is too much code so the transition must be done in steps.
Some struct variables have the volatile modifier, so I have to find a way to generate struct variables with volatile to ensure the C code behaves the same during the transition and everything can be tested.
On the rust side volatile behavior is achieved by using
read_volatile
/write_volatile
manually or with a wrapper.On the C side the variables must have the volatile modifier or I must cast every singe use of the variable to a volatile type (untested).
I am looking for a solution that avoids having to modify the original C code.
The ideal solution would be cbindgen generating the volatile modifier in specific struct variables, which allows me to change the structure at a later stage while ensuring the remaining C code behaves the same.
So, how do I mark a struct variable volatile?
The text was updated successfully, but these errors were encountered: