@@ -2275,64 +2275,56 @@ atomic_int! {
22752275 "AtomicU128::new(0)" ,
22762276 u128 AtomicU128 ATOMIC_U128_INIT
22772277}
2278- #[ cfg( target_has_atomic_load_store = "ptr" ) ]
2279- #[ cfg( target_pointer_width = "16" ) ]
2280- macro_rules! ptr_width {
2281- ( ) => {
2282- 2
2283- } ;
2284- }
2285- #[ cfg( target_has_atomic_load_store = "ptr" ) ]
2286- #[ cfg( target_pointer_width = "32" ) ]
2287- macro_rules! ptr_width {
2288- ( ) => {
2289- 4
2290- } ;
2291- }
2292- #[ cfg( target_has_atomic_load_store = "ptr" ) ]
2293- #[ cfg( target_pointer_width = "64" ) ]
2294- macro_rules! ptr_width {
2295- ( ) => {
2296- 8
2297- } ;
2298- }
2299- #[ cfg( target_has_atomic_load_store = "ptr" ) ]
2300- atomic_int ! {
2301- cfg( target_has_atomic = "ptr" ) ,
2302- cfg( target_has_atomic_equal_alignment = "ptr" ) ,
2303- stable( feature = "rust1" , since = "1.0.0" ) ,
2304- stable( feature = "extended_compare_and_swap" , since = "1.10.0" ) ,
2305- stable( feature = "atomic_debug" , since = "1.3.0" ) ,
2306- stable( feature = "atomic_access" , since = "1.15.0" ) ,
2307- stable( feature = "atomic_from" , since = "1.23.0" ) ,
2308- stable( feature = "atomic_nand" , since = "1.27.0" ) ,
2309- rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2310- stable( feature = "rust1" , since = "1.0.0" ) ,
2311- "isize" , "../../../std/primitive.isize.html" ,
2312- "" ,
2313- atomic_min, atomic_max,
2314- ptr_width!( ) ,
2315- "AtomicIsize::new(0)" ,
2316- isize AtomicIsize ATOMIC_ISIZE_INIT
2278+
2279+ macro_rules! atomic_int_ptr_sized {
2280+ ( $( $target_pointer_width: literal $align: literal) * ) => { $(
2281+ #[ cfg( target_has_atomic_load_store = "ptr" ) ]
2282+ #[ cfg( target_pointer_width = $target_pointer_width) ]
2283+ atomic_int! {
2284+ cfg( target_has_atomic = "ptr" ) ,
2285+ cfg( target_has_atomic_equal_alignment = "ptr" ) ,
2286+ stable( feature = "rust1" , since = "1.0.0" ) ,
2287+ stable( feature = "extended_compare_and_swap" , since = "1.10.0" ) ,
2288+ stable( feature = "atomic_debug" , since = "1.3.0" ) ,
2289+ stable( feature = "atomic_access" , since = "1.15.0" ) ,
2290+ stable( feature = "atomic_from" , since = "1.23.0" ) ,
2291+ stable( feature = "atomic_nand" , since = "1.27.0" ) ,
2292+ rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2293+ stable( feature = "rust1" , since = "1.0.0" ) ,
2294+ "isize" , "../../../std/primitive.isize.html" ,
2295+ "" ,
2296+ atomic_min, atomic_max,
2297+ $align,
2298+ "AtomicIsize::new(0)" ,
2299+ isize AtomicIsize ATOMIC_ISIZE_INIT
2300+ }
2301+ #[ cfg( target_has_atomic_load_store = "ptr" ) ]
2302+ #[ cfg( target_pointer_width = $target_pointer_width) ]
2303+ atomic_int! {
2304+ cfg( target_has_atomic = "ptr" ) ,
2305+ cfg( target_has_atomic_equal_alignment = "ptr" ) ,
2306+ stable( feature = "rust1" , since = "1.0.0" ) ,
2307+ stable( feature = "extended_compare_and_swap" , since = "1.10.0" ) ,
2308+ stable( feature = "atomic_debug" , since = "1.3.0" ) ,
2309+ stable( feature = "atomic_access" , since = "1.15.0" ) ,
2310+ stable( feature = "atomic_from" , since = "1.23.0" ) ,
2311+ stable( feature = "atomic_nand" , since = "1.27.0" ) ,
2312+ rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2313+ stable( feature = "rust1" , since = "1.0.0" ) ,
2314+ "usize" , "../../../std/primitive.usize.html" ,
2315+ "" ,
2316+ atomic_umin, atomic_umax,
2317+ $align,
2318+ "AtomicUsize::new(0)" ,
2319+ usize AtomicUsize ATOMIC_USIZE_INIT
2320+ }
2321+ ) * } ;
23172322}
2318- #[ cfg( target_has_atomic_load_store = "ptr" ) ]
2319- atomic_int ! {
2320- cfg( target_has_atomic = "ptr" ) ,
2321- cfg( target_has_atomic_equal_alignment = "ptr" ) ,
2322- stable( feature = "rust1" , since = "1.0.0" ) ,
2323- stable( feature = "extended_compare_and_swap" , since = "1.10.0" ) ,
2324- stable( feature = "atomic_debug" , since = "1.3.0" ) ,
2325- stable( feature = "atomic_access" , since = "1.15.0" ) ,
2326- stable( feature = "atomic_from" , since = "1.23.0" ) ,
2327- stable( feature = "atomic_nand" , since = "1.27.0" ) ,
2328- rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2329- stable( feature = "rust1" , since = "1.0.0" ) ,
2330- "usize" , "../../../std/primitive.usize.html" ,
2331- "" ,
2332- atomic_umin, atomic_umax,
2333- ptr_width!( ) ,
2334- "AtomicUsize::new(0)" ,
2335- usize AtomicUsize ATOMIC_USIZE_INIT
2323+
2324+ atomic_int_ptr_sized ! {
2325+ "16" 2
2326+ "32" 4
2327+ "64" 8
23362328}
23372329
23382330#[ inline]
0 commit comments