From f2a9a817866deb0ddadb9c0348ca1b23b5fc6016 Mon Sep 17 00:00:00 2001
From: Hanicef <gustaf@hanicef.me>
Date: Sun, 31 Dec 2023 17:28:59 +0100
Subject: [PATCH] Fix Windows build

---
 src/dedicated/i_system.c  |  2 ++
 src/dedicated/i_threads.c | 12 ++++++------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/dedicated/i_system.c b/src/dedicated/i_system.c
index 0b0f5e1daf..94937504d1 100644
--- a/src/dedicated/i_system.c
+++ b/src/dedicated/i_system.c
@@ -213,7 +213,9 @@ UINT8 graphics_started = 0;
 UINT8 keyboard_started = 0;
 
 static boolean consolevent = false;
+#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
 static boolean framebuffer = false;
+#endif
 
 static size_t num_exit_funcs;
 static void (*exit_funcs[MAX_EXIT_FUNCS])(void);
diff --git a/src/dedicated/i_threads.c b/src/dedicated/i_threads.c
index cae44dfb30..7503d34a23 100644
--- a/src/dedicated/i_threads.c
+++ b/src/dedicated/i_threads.c
@@ -292,10 +292,10 @@ void I_hold_cond(I_cond *cond_anchor, I_mutex mutex_id)
 void I_wake_one_cond(I_cond *anchor)
 {
 	EnterCriticalSection(&thread_lock);
-	if (*cond_anchor == NULL)
+	if (*anchor == NULL)
 	{
-		*cond_anchor = malloc(sizeof(CONDITION_VARIABLE));
-		InitializeConditionVariable(*cond_anchor);
+		*anchor = malloc(sizeof(CONDITION_VARIABLE));
+		InitializeConditionVariable(*anchor);
 	}
 	LeaveCriticalSection(&thread_lock);
 	WakeConditionVariable(*anchor);
@@ -304,10 +304,10 @@ void I_wake_one_cond(I_cond *anchor)
 void I_wake_all_cond(I_cond *anchor)
 {
 	EnterCriticalSection(&thread_lock);
-	if (*cond_anchor == NULL)
+	if (*anchor == NULL)
 	{
-		*cond_anchor = malloc(sizeof(CONDITION_VARIABLE));
-		InitializeConditionVariable(*cond_anchor);
+		*anchor = malloc(sizeof(CONDITION_VARIABLE));
+		InitializeConditionVariable(*anchor);
 	}
 	LeaveCriticalSection(&thread_lock);
 	WakeAllConditionVariable(*anchor);
-- 
GitLab