1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![feature(cfg_target_has_atomic, no_core, intrinsics, lang_items)]
15 extern "rust-intrinsic" {
16 fn atomic_xadd<T>(dst: *mut T, src: T) -> T;
24 #[cfg(target_has_atomic = "8")]
25 pub unsafe fn atomic_u8(x: *mut u8) {
29 #[cfg(target_has_atomic = "8")]
30 pub unsafe fn atomic_i8(x: *mut i8) {
33 #[cfg(target_has_atomic = "16")]
34 pub unsafe fn atomic_u16(x: *mut u16) {
37 #[cfg(target_has_atomic = "16")]
38 pub unsafe fn atomic_i16(x: *mut i16) {
41 #[cfg(target_has_atomic = "32")]
42 pub unsafe fn atomic_u32(x: *mut u32) {
45 #[cfg(target_has_atomic = "32")]
46 pub unsafe fn atomic_i32(x: *mut i32) {
49 #[cfg(target_has_atomic = "64")]
50 pub unsafe fn atomic_u64(x: *mut u64) {
53 #[cfg(target_has_atomic = "64")]
54 pub unsafe fn atomic_i64(x: *mut i64) {
57 #[cfg(target_has_atomic = "ptr")]
58 pub unsafe fn atomic_usize(x: *mut usize) {
61 #[cfg(target_has_atomic = "ptr")]
62 pub unsafe fn atomic_isize(x: *mut isize) {