Skip to content

Commit

Permalink
fixup! Add cfg option gnu_time64_abi
Browse files Browse the repository at this point in the history
  • Loading branch information
snogge committed Sep 12, 2023
1 parent 55df933 commit 07f1026
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ fn is_gnu_time64_abi() -> bool {
}
Err(_) => panic!("CARGO_CFG_TARGET_OS not set"),
}
let ptrbits = match env::var("CARGO_CFG_TARGET_POINTER_WIDTH") {
let _ptrbits = match env::var("CARGO_CFG_TARGET_POINTER_WIDTH") {
Ok(bits) => {
if bits == "64" {
return false;
Expand All @@ -315,20 +315,20 @@ fn is_gnu_time64_abi() -> bool {
};
// At this point, we _know_ it is *-*-linux-gnu* with 32 bit
// pointers. Some 64 bit arch still have 32 bit pointers though.
let _arch = match env::var("CARGO_CFG_TARGET_ARCH") {
Ok(arch) => match &arch[..] {
"aarch64" | "loongarch64" | "mips64" | "mips64r6" | "powerpc64" | "riscv64"
| "s390x" | "sparc64"
if ptrbits == "32" =>
{
panic!("Unexpected 32 bit pointer arch {}", arch);
}
"x86_64" => {
return false;
}
_ => arch,
},
Err(_) => panic!("CARGO_CFG_TARGET_ARCH not set"),
};
// let _arch = match env::var("CARGO_CFG_TARGET_ARCH") {
// Ok(arch) => match &arch[..] {
// "aarch64" | "loongarch64" | "mips64" | "mips64r6" | "powerpc64" | "riscv64"
// | "s390x" | "sparc64" | "x86_64"
// if ptrbits == "32" =>
// {
// panic!("Unexpected 32 bit pointer arch {}", arch);
// }
// // "x86_64" => {
// // return false;
// // }
// _ => arch,
// },
// Err(_) => panic!("CARGO_CFG_TARGET_ARCH not set"),
// };
return true;
}

0 comments on commit 07f1026

Please sign in to comment.