1
0
Fork 0

Allow the Linux event loop on macOS

This commit is contained in:
Robbert van der Helm 2022-02-15 21:25:55 +01:00
parent d37b866115
commit b7904126ac
2 changed files with 7 additions and 2 deletions

View file

@ -9,10 +9,11 @@ mod windows;
#[cfg(all(target_family = "unix", not(target_os = "macos")))]
pub(crate) use self::linux::LinuxEventLoop as OsEventLoop;
// For now, also use the Linux event loop on macOS so it at least compiles
#[cfg(target_os = "macos")]
pub(crate) use self::linux::LinuxEventLoop as OsEventLoop;
#[cfg(target_os = "windows")]
pub(crate) use self::windows::WindowsEventLoop as OsEventLoop;
#[cfg(target_os = "macos")]
compile_error!("The macOS event loop has not yet been implemented");
use crate::param::internals::ParamPtr;
use crate::param::Param;

View file

@ -10,6 +10,10 @@ use super::{EventLoop, MainThreadExecutor};
use crate::nih_log;
/// See [super::EventLoop].
#[cfg_attr(
target_os = "macos",
deprecated = "macOS needs to have its own event loop implementation, this implementation may not work correctly"
)]
pub(crate) struct LinuxEventLoop<T, E> {
/// The thing that ends up executing these tasks. The tasks are usually executed from the worker
/// thread, but if the current thread is the main thread then the task cna also be executed