Skip to content

Commit a1e3082

Browse files
committed
Fixing compilation on Windows
Condvar isn't UnwindSafe on Windows either. See rust-lang/rust#118009
1 parent 7dc00f2 commit a1e3082

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ unicode-segmentation = "1.10.1"
3838

3939
# [patch."https://github.com/khonsulabs/kludgine"]
4040
# kludgine = { path = "../kludgine" }
41-
# [patch."https://github.com/khonsulabs/appit"]
42-
# appit = { path = "../appit" }
41+
# [patch.crates-io]
42+
# appit = { version = "0.1.0", path = "../appit" }
4343
# [patch."https://github.com/khonsulabs/figures"]
4444
# figures = { path = "../figures" }
4545

src/utils.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ use intentional::Assert;
66
use kludgine::app::winit::event::Modifiers;
77
use kludgine::app::winit::keyboard::ModifiersState;
88

9-
/// This [`Condvar`] is a wrapper that on Mac OS/iOS asserts unwind safety. On
9+
/// This [`Condvar`] is a wrapper that on Mac OS/iOS/Windows asserts unwind safety. On
1010
/// all other platforms, this is a transparent wrapper around `Condvar`. See
1111
/// <https://github.com/rust-lang/rust/issues/118009> for more information.
1212
#[derive(Debug, Default)]
1313
pub struct UnwindsafeCondvar(
14-
#[cfg(any(target_os = "ios", target_os = "macos"))] std::panic::AssertUnwindSafe<Condvar>,
15-
#[cfg(not(any(target_os = "ios", target_os = "macos")))] Condvar,
14+
#[cfg(any(target_os = "ios", target_os = "macos", target_os = "windows"))] std::panic::AssertUnwindSafe<Condvar>,
15+
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "windows")))] Condvar,
1616
);
1717

1818
impl Deref for UnwindsafeCondvar {
@@ -25,12 +25,12 @@ impl Deref for UnwindsafeCondvar {
2525

2626
impl UnwindsafeCondvar {
2727
pub const fn new() -> Self {
28-
#[cfg(any(target_os = "ios", target_os = "macos"))]
28+
#[cfg(any(target_os = "ios", target_os = "macos", target_os = "windows"))]
2929
{
3030
Self(std::panic::AssertUnwindSafe(Condvar::new()))
3131
}
3232

33-
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
33+
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "windows")))]
3434
{
3535
Self(Condvar::new())
3636
}

src/window.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use std::ffi::OsStr;
55
use std::ops::{Deref, DerefMut, Not};
66
use std::panic::{AssertUnwindSafe, UnwindSafe};
77
use std::path::Path;
8-
use std::process::Command;
98
use std::string::ToString;
109
use std::sync::{MutexGuard, OnceLock};
1110

@@ -1340,7 +1339,7 @@ impl Ranged for ThemeMode {
13401339
}
13411340

13421341
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "windows"))]
1343-
fn default_family(query: Family<'_>) -> Option<FamilyOwned> {
1342+
fn default_family(_query: Family<'_>) -> Option<FamilyOwned> {
13441343
// fontdb uses system APIs to determine these defaults.
13451344
None
13461345
}
@@ -1360,7 +1359,7 @@ fn default_family(query: Family<'_>) -> Option<FamilyOwned> {
13601359
Family::Name(_) => return None,
13611360
};
13621361

1363-
Command::new("fc-match")
1362+
std::process::Command::new("fc-match")
13641363
.arg("-f")
13651364
.arg("%{family}")
13661365
.arg(query)

0 commit comments

Comments
 (0)