
# Objective The goal of `bevy_platform_support` is to provide a set of platform agnostic APIs, alongside platform-specific functionality. This is a high traffic crate (providing things like HashMap and Instant). Especially in light of https://github.com/bevyengine/bevy/discussions/18799, it deserves a friendlier / shorter name. Given that it hasn't had a full release yet, getting this change in before Bevy 0.16 makes sense. ## Solution - Rename `bevy_platform_support` to `bevy_platform`.
44 lines
1.3 KiB
Rust
44 lines
1.3 KiB
Rust
//! Provides various atomic alternatives to language primitives.
|
|
//!
|
|
//! Certain platforms lack complete atomic support, requiring the use of a fallback
|
|
//! such as `portable-atomic`.
|
|
//! Using these types will ensure the correct atomic provider is used without the need for
|
|
//! feature gates in your own code.
|
|
|
|
pub use atomic_16::{AtomicI16, AtomicU16};
|
|
pub use atomic_32::{AtomicI32, AtomicU32};
|
|
pub use atomic_64::{AtomicI64, AtomicU64};
|
|
pub use atomic_8::{AtomicBool, AtomicI8, AtomicU8};
|
|
pub use atomic_ptr::{AtomicIsize, AtomicPtr, AtomicUsize};
|
|
pub use core::sync::atomic::Ordering;
|
|
|
|
#[cfg(target_has_atomic = "8")]
|
|
use core::sync::atomic as atomic_8;
|
|
|
|
#[cfg(not(target_has_atomic = "8"))]
|
|
use portable_atomic as atomic_8;
|
|
|
|
#[cfg(target_has_atomic = "16")]
|
|
use core::sync::atomic as atomic_16;
|
|
|
|
#[cfg(not(target_has_atomic = "16"))]
|
|
use portable_atomic as atomic_16;
|
|
|
|
#[cfg(target_has_atomic = "32")]
|
|
use core::sync::atomic as atomic_32;
|
|
|
|
#[cfg(not(target_has_atomic = "32"))]
|
|
use portable_atomic as atomic_32;
|
|
|
|
#[cfg(target_has_atomic = "64")]
|
|
use core::sync::atomic as atomic_64;
|
|
|
|
#[cfg(not(target_has_atomic = "64"))]
|
|
use portable_atomic as atomic_64;
|
|
|
|
#[cfg(target_has_atomic = "ptr")]
|
|
use core::sync::atomic as atomic_ptr;
|
|
|
|
#[cfg(not(target_has_atomic = "ptr"))]
|
|
use portable_atomic as atomic_ptr;
|