Skip to content

Commit

Permalink
feat(ext/webgpu): byow support for {Free,Open}BSD (denoland#23832)
Browse files Browse the repository at this point in the history
Both ports for the BSDs include patches to the same effect.
  • Loading branch information
VlkrS committed May 23, 2024
1 parent e450c6b commit 20dad29
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ext/webgpu/byow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ use deno_core::op2;
use deno_core::OpState;
use deno_core::ResourceId;
use std::ffi::c_void;
#[cfg(any(target_os = "linux", target_os = "macos"))]
#[cfg(any(
target_os = "linux",
target_os = "macos",
target_os = "freebsd",
target_os = "openbsd"
))]
use std::ptr::NonNull;

use crate::surface::WebGpuSurface;
Expand Down Expand Up @@ -103,7 +108,7 @@ fn raw_window(
Ok((win_handle, display_handle))
}

#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
fn raw_window(
system: &str,
window: *const c_void,
Expand Down Expand Up @@ -136,7 +141,7 @@ fn raw_window(
),
);
} else {
return Err(type_error("Invalid system on Linux"));
return Err(type_error("Invalid system on Linux/BSD"));
}

Ok((win_handle, display_handle))
Expand Down

0 comments on commit 20dad29

Please sign in to comment.