Use target family insted of target arch (#2975)

* Replace cfg target_arch wasm32 with target_family wasm

* Fix warnings in test builds from previous pr
This commit is contained in:
Timon 2025-08-03 12:28:53 +02:00 committed by GitHub
parent 1e3c3da3fe
commit 67123f55dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 106 additions and 96 deletions

View file

@ -42,7 +42,7 @@ pub trait Size {
fn size(&self) -> UVec2;
}
#[cfg(target_arch = "wasm32")]
#[cfg(target_family = "wasm")]
impl Size for web_sys::HtmlCanvasElement {
fn size(&self) -> UVec2 {
UVec2::new(self.width(), self.height())
@ -115,9 +115,9 @@ pub struct SurfaceHandle<Surface> {
pub surface: Surface,
}
// #[cfg(target_arch = "wasm32")]
// #[cfg(target_family = "wasm")]
// unsafe impl<T: dyn_any::WasmNotSend> Send for SurfaceHandle<T> {}
// #[cfg(target_arch = "wasm32")]
// #[cfg(target_family = "wasm")]
// unsafe impl<T: dyn_any::WasmNotSync> Sync for SurfaceHandle<T> {}
impl<S: Size> Size for SurfaceHandle<S> {
@ -153,9 +153,9 @@ impl<'a, Surface> Drop for SurfaceHandle<'a, Surface> {
}
}*/
#[cfg(target_arch = "wasm32")]
#[cfg(target_family = "wasm")]
pub type ResourceFuture = Pin<Box<dyn Future<Output = Result<Arc<[u8]>, ApplicationError>>>>;
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(target_family = "wasm"))]
pub type ResourceFuture = Pin<Box<dyn Future<Output = Result<Arc<[u8]>, ApplicationError>> + Send>>;
pub trait ApplicationIo {