Skip to content

Commit ad4f10f

Browse files
cionsErichDonGubler
authored andcommitted
[deno] fix android build
(cherry-picked from denoland/deno#30360)
1 parent 7f30a8d commit ad4f10f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

deno_webgpu/byow.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ use crate::surface::GPUCanvasContext;
2424

2525
#[derive(Debug, thiserror::Error, deno_error::JsError)]
2626
pub enum ByowError {
27+
#[cfg(not(any(
28+
target_os = "macos",
29+
target_os = "windows",
30+
target_os = "linux",
31+
target_os = "freebsd",
32+
target_os = "openbsd",
33+
)))]
34+
#[class(type)]
35+
#[error("Unsupported platform")]
36+
Unsupported,
2737
#[class(type)]
2838
#[error(
2939
"Cannot create surface outside of WebGPU context. Did you forget to call `navigator.gpu.requestAdapter()`?"
@@ -360,6 +370,6 @@ fn raw_window(
360370
_system: UnsafeWindowSurfaceSystem,
361371
_window: *const c_void,
362372
_display: *const c_void,
363-
) -> Result<RawHandles, deno_error::JsErrorBox> {
364-
Err(deno_error::JsErrorBox::type_error("Unsupported platform"))
373+
) -> Result<RawHandles, ByowError> {
374+
Err(ByowError::Unsupported)
365375
}

0 commit comments

Comments
 (0)