Hack to support multiple compiler versions.

This commit is contained in:
4lDO2
2023-04-30 17:32:39 +02:00
parent a3e1eed100
commit 4e5596698d
+14 -2
View File
@@ -56,14 +56,26 @@ impl FutexAtomicTy for AtomicU32 {
type Ty = u32;
fn ptr(&self) -> *mut u32 {
AtomicU32::as_ptr(self)
// TODO: Change when Redox's toolchain is updated. This is not about targets, but compiler
// versions!
#[cfg(target_os = "redox")]
return AtomicU32::as_ptr(self);
#[cfg(target_os = "linux")]
return AtomicU32::as_mut_ptr(self);
}
}
impl FutexAtomicTy for AtomicI32 {
type Ty = i32;
fn ptr(&self) -> *mut i32 {
AtomicI32::as_ptr(self)
// TODO
#[cfg(target_os = "redox")]
return AtomicI32::as_ptr(self);
#[cfg(target_os = "linux")]
return AtomicI32::as_mut_ptr(self);
}
}