From b7904126acbd57a8d60947409c889fe37db77ddd Mon Sep 17 00:00:00 2001
From: Robbert van der Helm <mail@robbertvanderhelm.nl>
Date: Tue, 15 Feb 2022 21:25:55 +0100
Subject: [PATCH] Allow the Linux event loop on macOS

---
 src/context.rs       | 5 +++--
 src/context/linux.rs | 4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/context.rs b/src/context.rs
index deb42694..30daf05f 100644
--- a/src/context.rs
+++ b/src/context.rs
@@ -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;
diff --git a/src/context/linux.rs b/src/context/linux.rs
index 66de482c..a92ee872 100644
--- a/src/context/linux.rs
+++ b/src/context/linux.rs
@@ -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