Crate winreg 64_32 Questions and general 64_32 Question


knows anybody how i can read and write with winreg general a key and winreg automatic detects if 32bit or 64bit and write to the wow-branch automaticly? Or must i check this on my self in rust? Which compiler-statements it give for this reason?

At the moment i have an 64Bit-Executable only and write to the wow-branch. Give it an compiler_statement or must i check directly in rust which os i have?

Must i every time switch my toolkit before i compile/build? Or can say the rust/cargo that he compile with the 64bit-toolkit an 32bit-executable? Is an 32/64Bit-Crossexecutable possible?



this page might be helpful:

It shows this example: cargo build --target=arm-unknown-linux-gnueabihf

You need to write configuration for this in .cargo/config file, It is mentioned in the linked page

On Rust side you can check if your code compiled for 32bit or 64bit via:

#[cfg(target_pointer_width = "32")]
fn some_func() {}

#[cfg(target_pointer_width = "64")]
fn some_func() {}

thx at both @davemilter and @oezgurmakkurt