Skip to content
Snippets Groups Projects
Verified Commit a7708a9f authored by Jacob Lorentzon's avatar Jacob Lorentzon :speech_balloon:
Browse files

Fix AtomicPtr::as_ptr compiler version problem.

parent 84e5b412
No related branches found
No related tags found
1 merge request!380Replace pthreads-emb with a native implementation
Pipeline #12089 failed
...@@ -59,12 +59,19 @@ impl FutexAtomicTy for AtomicU32 { ...@@ -59,12 +59,19 @@ impl FutexAtomicTy for AtomicU32 {
fn ptr(&self) -> *mut u32 { fn ptr(&self) -> *mut u32 {
// TODO: Change when Redox's toolchain is updated. This is not about targets, but compiler // TODO: Change when Redox's toolchain is updated. This is not about targets, but compiler
// versions! // versions!
/*
#[cfg(target_os = "redox")] #[cfg(target_os = "redox")]
return AtomicU32::as_ptr(self); return AtomicU32::as_ptr(self);
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
return AtomicU32::as_mut_ptr(self); return AtomicU32::as_mut_ptr(self);
*/
// AtomicU32::as_mut_ptr internally calls UnsafeCell::get, which itself simply does (&self
// as *const Self as *mut Self).
self as *const AtomicU32 as *mut u32
} }
} }
impl FutexAtomicTy for AtomicI32 { impl FutexAtomicTy for AtomicI32 {
...@@ -72,11 +79,13 @@ impl FutexAtomicTy for AtomicI32 { ...@@ -72,11 +79,13 @@ impl FutexAtomicTy for AtomicI32 {
fn ptr(&self) -> *mut i32 { fn ptr(&self) -> *mut i32 {
// TODO // TODO
#[cfg(target_os = "redox")] /*#[cfg(target_os = "redox")]
return AtomicI32::as_ptr(self); return AtomicI32::as_ptr(self);
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
return AtomicI32::as_mut_ptr(self); return AtomicI32::as_mut_ptr(self);*/
self as *const AtomicI32 as *mut i32
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment